-
Notifications
You must be signed in to change notification settings - Fork 115
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 multiarch support #12
Closed
Closed
Changes from all commits
Commits
Show all changes
24 commits
Select commit
Hold shift + click to select a range
c308df1
add multiple architecture Dockerfiles
ndanyluk c9e72ce
updatd makefile for multiple architectures
ndanyluk 613f072
add travis ci support for builds
ndanyluk 859fd93
add bats to travis config
ndanyluk c4f2a2d
addee architecture to image name
ndanyluk 026e5ea
Update tags and tests to handle different arches
ndanyluk 3d67723
Add proper install directory for BATS and comments
ndanyluk 80f92bd
Fix make command
ndanyluk ca91402
correct dockerfile symlink in make
ndanyluk 93719e5
Merge branch 'stable' of github.com:ndanyluk/docker-light-baseimage i…
ndanyluk 9a76da5
correct arch argument to travis-ci
ndanyluk 9b08e4b
fixed build directory
ndanyluk 30fc695
move qemu to correct build directory
ndanyluk c7f24a1
Fix BATS test for travis
ndanyluk 19813fc
removed BATS tests from travis
ndanyluk 94cc96b
fixed missing }
ndanyluk 52a95ae
added multi-arch build step
ndanyluk 13407af
add command to docker run test step
ndanyluk d1521ad
detach docker container in test step
ndanyluk f8a2ef7
fix test script
ndanyluk b696ff0
fixed docker push
ndanyluk 35b2b69
substitute osixia for ndanyluk
ndanyluk 84cb0ce
substitute osixia for ndanyluk
ndanyluk 15b09c8
Bump QEMU version to 4.0.0-2
ndanyluk File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
sudo: required | ||
|
||
language: generic | ||
|
||
services: | ||
- docker | ||
|
||
env: | ||
global: | ||
- qemu_version=4.0.0-2 | ||
- target_version=1.1.2 | ||
matrix: | ||
- target_arch=amd64 qemu_arch=x86_64 | ||
- target_arch=armv7 qemu_arch=arm | ||
# - target_arch=armv6 qemu_arch=arm <------ NOT SUPPORTED BY DEBIAN STRETCH BASE IMAGE | ||
- target_arch=arm64 qemu_arch=aarch64 | ||
|
||
before_install: | ||
- curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add - | ||
- sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" | ||
- sudo apt-get update | ||
- sudo apt-get -y install docker-ce | ||
- mkdir $HOME/.docker | ||
- 'echo "{" > $HOME/.docker/config.json' | ||
- 'echo " \"experimental\": \"enabled\"" >> $HOME/.docker/config.json' | ||
- 'echo "}" >> $HOME/.docker/config.json' | ||
- sudo service docker restart | ||
- git clone https://github.com/sstephenson/bats.git | ||
- cd bats | ||
- sudo ./install.sh /usr/local | ||
- cd .. | ||
|
||
install: | ||
- docker run --rm --privileged multiarch/qemu-user-static:register | ||
- curl -sLO https://github.com/multiarch/qemu-user-static/releases/download/v${qemu_version}/qemu-${qemu_arch}-static.tar.gz; | ||
- tar -xzvf qemu-${qemu_arch}-static.tar.gz; | ||
- mv qemu-${qemu_arch}-static image/ | ||
- make build ARCH=${target_arch} | ||
|
||
script: | ||
- docker run -d --name test_image osixia/light-baseimage-${target_arch}:${target_version} sleep 10 | ||
- sleep 5 | ||
- sudo docker ps | grep -q test_image | ||
|
||
after_success: | ||
- if [ -z "$DOCKER_USER" ]; then | ||
echo "PR build, skipping Docker Hub push"; | ||
else | ||
docker login -u "$DOCKER_USER" -p "$DOCKER_PASS"; | ||
make tag-latest push push-latest ARCH=${target_arch}; | ||
fi | ||
|
||
jobs: | ||
include: | ||
- stage: deploy | ||
install: skip | ||
script: skip | ||
after_success: | ||
- if [ -z "$DOCKER_USER" ]; then | ||
echo "PR build, skipping Docker Hub push"; | ||
else | ||
docker login -u "$DOCKER_USER" -p "$DOCKER_PASS"; | ||
docker manifest create osixia/light-baseimage:${target_version} osixia/light-baseimage-armv7:${target_version} osixia/light-baseimage-arm64:${target_version} osixia/light-baseimage-amd64:${target_version}; | ||
docker manifest create osixia/light-baseimage:latest osixia/light-baseimage-armv7:latest osixia/light-baseimage-amd64:latest osixia/light-baseimage-arm64:latest; | ||
docker manifest push osixia/light-baseimage:${target_version}; | ||
docker manifest push osixia/light-baseimage:latest; | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
FROM debian:stretch-slim | ||
|
||
#COPY qemu-x86_64-static /usr/bin | ||
|
||
COPY . /container | ||
RUN /container/build.sh | ||
|
||
ENV LANG="en_US.UTF-8" \ | ||
LANGUAGE="en_US:en" \ | ||
LC_ALL="en_US.UTF-8" | ||
|
||
ENTRYPOINT ["/container/tool/run"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
FROM arm64v8/debian:stretch-slim | ||
|
||
COPY qemu-aarch64-static /usr/bin | ||
|
||
COPY . /container | ||
RUN /container/build.sh | ||
|
||
ENV LANG="en_US.UTF-8" \ | ||
LANGUAGE="en_US:en" \ | ||
LC_ALL="en_US.UTF-8" | ||
|
||
ENTRYPOINT ["/container/tool/run"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
FROM arm32v7/debian:stretch-slim | ||
|
||
COPY qemu-arm-static /usr/bin | ||
|
||
COPY . /container | ||
RUN /container/build.sh | ||
|
||
ENV LANG="en_US.UTF-8" \ | ||
LANGUAGE="en_US:en" \ | ||
LC_ALL="en_US.UTF-8" | ||
|
||
ENTRYPOINT ["/container/tool/run"] |
File renamed without changes.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hello Everyone,
Out of curiosity. Is there a specific reason that the old bats was preferred and not the new repository (https://github.com/bats-core/bats-core)? Apparently the sstephenson/bats is abandoned (sstephenson/bats#248) and a new community has already emerge (sstephenson/bats#150).
Also I would pin the checkout to a specific version/release, so you are certain that something is broken in your build and not in your build scripts :)
KR,
Vasileios
Update: Nevermind. I saw that in the documentation of the image we are also using the old version.