Created
September 19, 2017 20:27
-
-
Save mrunalp/a9cf930fd2e6a3517a14a51719cfa28b to your computer and use it in GitHub Desktop.
build_docker.sh
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
set -e | |
set -x | |
RUNC_GOPATH="$(mktemp -d)" | |
CONTAINERD_GOPATH="$(mktemp -d)" | |
PWD="$(pwd)" | |
function cleanup() { | |
rm -rf "${RUNC_GOPATH}" | |
rm -rf "${CONTAINERD_GOPATH}" | |
cd "${PWD}" | |
} | |
trap cleanup EXIT | |
dockerfile_path="${GOPATH}/src/github.com/docker/docker/Dockerfile" | |
#RUNC_COMMIT=$(grep RUNC_COMMIT $dockerfile_path | head -n 1 | cut -d" " -f 3) | |
RUNC_COMMIT=31a9f6e22729606814e9bcbcf9eeebc1887527cb | |
echo $RUNC_COMMIT | |
CONTAINERD_COMMIT=$(grep CONTAINERD_COMMIT $dockerfile_path | head -n 1 | cut -d" " -f 3) | |
echo $CONTAINERD_COMMIT | |
echo "Building runc" | |
GOPATH=$RUNC_GOPATH | |
git clone git://github.com/projectatomic/runc.git "$GOPATH/src/github.com/opencontainers/runc" | |
pushd "$GOPATH/src/github.com/opencontainers/runc" | |
git checkout -q "$RUNC_COMMIT" | |
make BUILDTAGS="seccomp selinux" | |
cp runc /usr/local/bin/docker-runc | |
popd | |
echo "Building containerd" | |
GOPATH=$CONTAINERD_GOPATH | |
git clone git://github.com/docker/containerd.git "$GOPATH/src/github.com/docker/containerd" | |
pushd "$GOPATH/src/github.com/docker/containerd" | |
git checkout -q "$CONTAINERD_COMMIT" | |
make | |
cp bin/containerd /usr/local/bin/docker-containerd | |
cp bin/containerd-shim /usr/local/bin/docker-containerd-shim | |
cp bin/ctr /usr/local/bin/docker-containerd-ctr | |
popd |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment