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

[WIP] multiarch: Pull tarballs #337

Closed
wants to merge 21 commits into from
Closed
Changes from 1 commit
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
ea02a45
Add -a flag for multiarch support in alpine-builder.
alexkreidler Aug 15, 2017
849e396
Add ARCHS variable for building different architectures.
alexkreidler Aug 16, 2017
bff6d50
Add an example of multi-arch
alexkreidler Aug 16, 2017
1e628d9
Update docs for multi-arch
alexkreidler Aug 16, 2017
30c3026
Fix typo in library-edge options
alexkreidler Aug 17, 2017
1ff565c
Update library spec generator for multi-arch
alexkreidler Aug 17, 2017
8d0364a
Fix tagging of images for multi-arch
alexkreidler Aug 19, 2017
8bc9dc9
Fix style shellcheck issues, add comments
alexkreidler Aug 20, 2017
51e4e16
Fix rootfs commit glob issue by adding globstar option.
alexkreidler Aug 20, 2017
6498f39
Update .gitignore for new multi-arch structure.
alexkreidler Aug 20, 2017
c2585bf
Rewrite commit loop based on options files, fix commit issues.
alexkreidler Aug 20, 2017
2ac88ef
Fix library spec issues
alexkreidler Aug 22, 2017
92e868f
Fix multi-arch builds using binfmt_misc and cross-docker
alexkreidler Sep 4, 2017
fa25e94
More binfmt_misc, CI test
alexkreidler Sep 10, 2017
bc8f92b
Revert "More binfmt_misc, CI test"
alexkreidler Sep 10, 2017
baf05c5
Revert "Fix multi-arch builds using binfmt_misc and cross-docker"
alexkreidler Sep 18, 2017
e87c348
Merge remote-tracking branch 'gliderlabs/master'
alexkreidler Sep 18, 2017
31d2112
Merge branch 'master' into multi-arch
alexkreidler Sep 18, 2017
6fe6421
[ci skip] begin to split the build script
alexkreidler Sep 19, 2017
538e0f2
WIP, more pulling tarballs [ci skip]
alexkreidler Sep 23, 2017
3a439c0
Update .gitignore
alexkreidler Sep 25, 2017
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
47 changes: 43 additions & 4 deletions build
Original file line number Diff line number Diff line change
Expand Up @@ -99,18 +99,57 @@ push() {
}

library() {

convert() {
# takes a space-separated list of alpine-linux architectures, and returns a space-separated list of docker architectures
local i=0
for arch in $@; do
case "$arch" in # converts Alpine Linux arch strings to Docker arch strings
x86_64) echo -n "amd64";;
x86) echo -n "i386";;
armhf) echo -n "arm32v7";; # TODO: What about arm32v7
aarch64) echo -n "arm64v8";;
ppc64le) echo -n "ppc64le";;
s390x) echo -n "s390x";;
*) return 1;; # Fail on unknown archs
esac
if [[ i -ne $#-1 ]]; then
Copy link
Collaborator

Choose a reason for hiding this comment

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

is there a missing $ for i?

  if [[ $i -ne $#-1 ]]; then

echo -n " "
fi
let i=$i+1
done
}

echo
echo "# maintainer: Glider Labs <[email protected]> (@gliderlabs)"
echo "# autogenerated by https://github.com/gliderlabs/docker-alpine/blob/master/build"
echo
echo "GitRepo: https://github.com/gliderlabs/docker-alpine.git"

for file in versions/library-*/options; do
# shellcheck source=versions/library-3.2/options
source "$file"
local refs
refs="$(git ls-remote --exit-code --heads origin rootfs/library-${RELEASE#v})"
: "${refs:?}"
for tag in "${TAGS[@]}"; do
echo "${tag#*:}:" \
"git://github.com/gliderlabs/docker-alpine@${refs:0:40}" \
"versions/library-${RELEASE#v}"
tags=${TAGS[@]}
[[ "$ARCHS" ]] || { # compatability with older configs that were only written for x86_64 architectures
ARCHS=("x86_64")
}
a=$(convert ${ARCHS[@]})

printf "\nTags:" && echo ${tags// /, }
echo "Architectures:" ${a// /, }
echo "GitCommit:" ${refs:0:40}

local i=0
for arch in $a; do
printf "%s-Directory: " "$arch"
echo "versions/library-${RELEASE#v}/${ARCHS[i]}"
let i=i+1
done
done
echo
}

main() {
Expand Down