You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
153 lines
5.7 KiB
153 lines
5.7 KiB
7 years ago
|
# NOTE: Docker uses their own versions of several programs, installed as docker-*
|
||
|
# They could be installed separately, and linked with their docker-* names,
|
||
|
# but docker is very picky about exactly which commit of these it's running.
|
||
|
# As such, I will bundle the docker-specific versions in this package,
|
||
|
# instead of spreading them over multiple packages.
|
||
|
|
||
|
# The exact commit number for these programs is specified in
|
||
|
# components/engine/hack/dockerfile/binaries-commits in the docker archive.
|
||
|
|
||
|
name=docker
|
||
|
version=17.06.2-ce
|
||
|
version_runc=810190ceaa507aa2727d7ae6f4790c76ec150bd2
|
||
|
version_containerd=6e23458c129b551d5c9871e5174f6b1b7f6d1170
|
||
|
version_tini=949e6facb77383876aeff8a6944dde66b3089574
|
||
|
version_libnetwork=7b2b1feb1de4817d522cc372af149ff48d25028e
|
||
|
update_url="https://github.com/$name/$name-ce/releases"
|
||
|
update_names="/archive/v$version.tar.gz"
|
||
|
|
||
|
dlextract "https://github.com/$name/$name-ce/archive/v$version/$name-$version.tar.gz" \
|
||
|
'45f92308bd542b6a8344c490d0383b64'
|
||
|
dlextract "https://github.com/$name/runc/archive/$version_runc/runc-$version_runc.tar.gz" \
|
||
|
'd2d5d628662bfbe11fd0d1bb7eb1c63c'
|
||
|
dlextract "https://github.com/$name/containerd/archive/$version_containerd/containerd-$version_containerd.tar.gz" \
|
||
|
'd1d057d831d46021cefee3a3c52c6c65'
|
||
|
dlextract "https://github.com/krallin/tini/archive/$version_tini/tini-$version_tini.tar.gz" \
|
||
|
'9873191fc835a79cb94b24377391667e'
|
||
|
dlextract "https://github.com/$name/libnetwork/archive/$version_libnetwork/libnetwork-$version_libnetwork.tar.gz" \
|
||
|
'9360e38c43e862e42c128db1852ac5bb'
|
||
|
_
|
||
|
|
||
|
# Verify that the dependency programs' versions match
|
||
|
# This should avoid the packager to have to manually check the file every update
|
||
|
(
|
||
|
. "$name-ce-$version/components/engine/hack/dockerfile/binaries-commits"
|
||
|
mismatches=""
|
||
|
for dependency in runc containerd tini libnetwork; do
|
||
|
if [ "$(eval echo \${version_$dependency})" != \
|
||
|
"$(eval echo \${$(echo $dependency | tr a-z A-Z)_COMMIT})" ]; then
|
||
|
mismatches+="$dependency: $(eval echo \${$(echo $dependency | tr a-z A-Z)_COMMIT})
|
||
|
"
|
||
|
fi
|
||
|
done
|
||
|
|
||
|
if [ "$mismatches" ]; then
|
||
|
echo "Error: Mismatching commit for one or more dependencies"
|
||
|
printf "%s" "$mismatches"
|
||
|
exit 1
|
||
|
fi
|
||
|
)
|
||
|
|
||
|
# Some scripts apparently like to pick up and misuse LDFLAGS for go
|
||
|
unset LDFLAGS
|
||
|
|
||
|
# Set up a fake GOPATH
|
||
|
mkdir -p ".gopath/src/github.com/$name" \
|
||
|
'.gopath/src/github.com/opencontainers' \
|
||
|
'.gopath/src/github.com/containerd'
|
||
|
ln -rs "$name-ce-$version/components/cli" ".gopath/src/github.com/$name/cli"
|
||
|
ln -rs "$name-ce-$version/components/engine" ".gopath/src/github.com/$name/$name"
|
||
|
ln -rs "runc-$version_runc" '.gopath/src/github.com/opencontainers/runc'
|
||
|
ln -rs "containerd-$version_containerd" '.gopath/src/github.com/containerd/containerd'
|
||
|
ln -rs "libnetwork-$version_libnetwork" ".gopath/src/github.com/$name/libnetwork"
|
||
|
export GOPATH="$PWD/.gopath"
|
||
|
|
||
|
# Build engine
|
||
|
( cd "$name-ce-$version/components/engine"
|
||
|
DOCKER_GITCOMMIT="$version" \
|
||
|
DOCKER_BUILDTAGS='seccomp' \
|
||
|
hack/make.sh dynbinary
|
||
|
)
|
||
|
|
||
|
# Build cli
|
||
|
( cd "$name-ce-$version/components/cli"
|
||
|
make VERSION="$version" dynbinary
|
||
|
|
||
|
mkdir -p man/man1
|
||
|
go build -v -o gen-manpages "github.com/$name/cli/man"
|
||
|
./gen-manpages --root . --target man/man1
|
||
|
|
||
|
if command -v go-md2man 2> /dev/null; then
|
||
|
./man/md2man-all.sh -q
|
||
|
fi
|
||
|
)
|
||
|
|
||
|
# Build runc
|
||
|
( cd "$GOPATH/src/github.com/opencontainers/runc"
|
||
|
make BUILDTAGS='seccomp' \
|
||
|
GIT_BRANCH=HEAD \
|
||
|
COMMIT_NO="$version_runc" \
|
||
|
COMMIT="$version_runc"
|
||
|
)
|
||
|
|
||
|
# Build containerd
|
||
|
make -C "containerd-$version_containerd"
|
||
|
|
||
|
# Build tini
|
||
|
( cd "tini-$version_tini"
|
||
|
cmake .
|
||
|
make tini-static
|
||
|
)
|
||
|
|
||
|
# Build proxy
|
||
|
( cd "libnetwork-$version_libnetwork"
|
||
|
go build -v -ldflags="-linkmode=external" -o proxy ./cmd/proxy
|
||
|
)
|
||
|
|
||
|
# Install engine
|
||
|
( cd "$name-ce-$version/components/engine"
|
||
|
install -Dm755 -t "$dir_install/$dir_prefix/$dir_bin" "bundles/latest/dynbinary-daemon/${name}d"
|
||
|
|
||
|
install -Dm644 -t "$dir_install/$dir_prefix/$dir_data/vim/vimfiles/syntax" \
|
||
|
contrib/syntax/vim/syntax/dockerfile.vim
|
||
|
install -Dm644 -t "$dir_install/$dir_prefix/$dir_data/vim/vimfiles/ftdetect" \
|
||
|
contrib/syntax/vim/ftdetect/dockerfile.vim
|
||
|
)
|
||
|
|
||
|
# Install cli
|
||
|
( cd "$name-ce-$version/components/cli"
|
||
|
install -Dm755 -t "$dir_install/$dir_prefix/$dir_bin" "build/$name"
|
||
|
|
||
|
install -Dm644 -t "$dir_install/$dir_prefix/$dir_data/bash-completion/completions" \
|
||
|
"contrib/completion/bash/$name"
|
||
|
install -Dm644 -t "$dir_install/$dir_prefix/$dir_data/zsh/site-functions" \
|
||
|
"contrib/completion/zsh/_$name"
|
||
|
install -Dm644 -t "$dir_install/$dir_prefix/$dir_data/fish/vendor_completions.d" \
|
||
|
"contrib/completion/fish/$name.fish"
|
||
|
|
||
|
mkdir -p "$dir_install/$dir_prefix/$dir_man"
|
||
|
cp -at "$dir_install/$dir_prefix/$dir_man" man/man*
|
||
|
)
|
||
|
|
||
|
# Install runc
|
||
|
install -Dm755 "runc-$version_runc/runc" \
|
||
|
"$dir_install/$dir_prefix/$dir_bin/$name-runc"
|
||
|
|
||
|
# Install containerd
|
||
|
install -Dm755 "containerd-$version_containerd/bin/containerd" \
|
||
|
"$dir_install/$dir_prefix/$dir_bin/$name-containerd"
|
||
|
install -Dm755 "containerd-$version_containerd/bin/containerd-shim" \
|
||
|
"$dir_install/$dir_prefix/$dir_bin/$name-containerd-shim"
|
||
|
install -Dm755 "containerd-$version_containerd/bin/ctr" \
|
||
|
"$dir_install/$dir_prefix/$dir_bin/$name-containerd-ctr"
|
||
|
|
||
|
# Install tini
|
||
|
install -Dm755 "tini-$version_tini/tini-static" \
|
||
|
"$dir_install/$dir_prefix/$dir_bin/$name-init"
|
||
|
|
||
|
# Install proxy
|
||
|
install -Dm755 "libnetwork-$version_libnetwork/proxy" \
|
||
|
"$dir_install/$dir_prefix/$dir_bin/$name-proxy"
|
||
|
|
||
|
# vim:set tabstop=4 shiftwidth=4 syntax=sh expandtab:
|