Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a new multiarch/qemu-user-static image. #75

Merged
merged 1 commit into from
Jul 28, 2019

Conversation

junaruga
Copy link
Member

@junaruga junaruga commented Jul 28, 2019

This PR is related to #37 (comment) .

I implemented below features. Thank you https://github.com/dbhi/qus project, that inspired us!

  • Check/ensure that ADD does extract the tarball and not only copy it:
  • Add all the binaries in multiarch/qemu-user-static:* images to image multiarch/qemu-user-static:register.

That includes both the register script file and qemu-$arch-static binary files.
Because when we want to run the register script (qemu-binfmt-conf.sh)
with "--persistent" option, to register the binary format entries with "flags: F",
the interpreters "/usr/bin/qemu-$arch-static" need to be existed.

See https://www.kernel.org/doc/html/latest/admin-guide/binfmt-misc.html

Other notable changes

  • Modify to save files on containers directory for container images.
  • test.sh for CI gating test.

The result of my tests

I tested like this.

$ git diff
diff --git a/.travis.yml b/.travis.yml
index 79ca070..edee35e 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -15,13 +15,13 @@ env:
         - VERSION=4.0.0-5
         # See qemu-user-static's RPM spec file on Fedora to check the new version.
         # https://src.fedoraproject.org/rpms/qemu/blob/master/f/qemu.spec
-        - DOCKER_SERVER=docker.io
-        # - DOCKER_SERVER=quay.io
+        # - DOCKER_SERVER=docker.io
+        - DOCKER_SERVER=quay.io
         # Git repository
         - REPO=multiarch/qemu-user-static
         # Container repository
-        - DOCKER_REPO=$DOCKER_SERVER/multiarch/qemu-user-static
-        # - DOCKER_REPO=$DOCKER_SERVER/your_username/qemu-user-static
+        # - DOCKER_REPO=$DOCKER_SERVER/multiarch/qemu-user-static
+        - DOCKER_REPO=$DOCKER_SERVER/junaruga/qemu-user-static
 
         - PACKAGE_URI="https://kojipkgs.fedoraproject.org/packages/qemu/4.0.0/5.fc31/x86_64/qemu-user-static-4.0.0-5.fc31.x86_64.rpm"
         - PACKAGE_FILENAME=$(basename "$PACKAGE_URI")
@@ -39,7 +39,7 @@ script:
     - ./test.sh -d "$DOCKER_REPO"
 after_success:
     - |
-      if [[ $TRAVIS_BRANCH == 'master' && $TRAVIS_PULL_REQUEST == 'false' ]]; then
+      # if [[ $TRAVIS_BRANCH == 'master' && $TRAVIS_PULL_REQUEST == 'false' ]]; then
           docker login -u="$DOCKER_USERNAME" -p="$DOCKER_PASSWORD" "$DOCKER_SERVER" && \
               docker push "$DOCKER_REPO"
-      fi
+      # fi

Deprecate the concept of 'Compatible images'

After this PR will be merged, we can build and run standard multiarch images without using the multiarch compatible images.

$ sudo docker run --rm --privileged quay.io/junaruga/qemu-user-static --reset -p yes

$ docker run --rm -t arm64v8/ubuntu uname -m
aarch64

$ docker run --rm -t arm64v8/fedora uname -m
aarch64

That includes both the register script file and qemu-$arch-static binary files.
Because when we want to run the register script (qemu-binfmt-conf.sh)
with "--persistent" option, to register the binary format entries with "flags: F",
the interpreters "/usr/bin/qemu-$arch-static" need to be existed.

See https://www.kernel.org/doc/html/latest/admin-guide/binfmt-misc.html

Other notable changes
* Modify to save files on containers directory for container images.
* test.sh for CI gating test.
@junaruga junaruga force-pushed the feature/unified-image branch from 415888a to 9898439 Compare July 28, 2019 03:29
Copy link
Member

@moul moul left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@moul moul merged commit 1530f63 into multiarch:master Jul 28, 2019
@junaruga
Copy link
Member Author

@moul Thanks for reviewing!

@junaruga junaruga deleted the feature/unified-image branch July 28, 2019 06:40
@junaruga
Copy link
Member Author

The new image works!

$ sudo docker run --rm --privileged multiarch/qemu-user-static --reset -p yes
$ docker pull arm64v8/ubuntu
$ docker run --rm -t arm64v8/ubuntu uname -m
aarch64

$ sudo podman run --rm --privileged multiarch/qemu-user-static --reset -p yes
$ podman pull arm64v8/fedora
$ podman run --rm -t arm64v8/fedora uname -m
aarch64

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants