mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
Add function for copy containerd
This adds a function for copying containerd and other binaries as well as adding a hash for those files. Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
This commit is contained in:
parent
de9ff4bdc0
commit
78568f2eb5
3 changed files with 24 additions and 30 deletions
22
hack/make.sh
22
hack/make.sh
|
@ -289,6 +289,28 @@ bundle() {
|
||||||
source "$SCRIPTDIR/make/$bundle" "$@"
|
source "$SCRIPTDIR/make/$bundle" "$@"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
copy_containerd() {
|
||||||
|
dir="$1"
|
||||||
|
# Add nested executables to bundle dir so we have complete set of
|
||||||
|
# them available, but only if the native OS/ARCH is the same as the
|
||||||
|
# OS/ARCH of the build target
|
||||||
|
if [ "$(go env GOOS)/$(go env GOARCH)" == "$(go env GOHOSTOS)/$(go env GOHOSTARCH)" ]; then
|
||||||
|
(set -x
|
||||||
|
if [ -x /usr/local/bin/runc ]; then
|
||||||
|
echo "Copying nested executables into $dir"
|
||||||
|
cp /usr/local/bin/runc "$dir/"
|
||||||
|
cp /usr/local/bin/ctr "$dir/"
|
||||||
|
cp /usr/local/bin/containerd "$dir/"
|
||||||
|
cp /usr/local/bin/containerd-shim "$dir/"
|
||||||
|
hash_files "$dir/runc"
|
||||||
|
hash_files "$dir/ctr"
|
||||||
|
hash_files "$dir/containerd"
|
||||||
|
hash_files "$dir/containerd-shim"
|
||||||
|
fi
|
||||||
|
)
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
main() {
|
main() {
|
||||||
# We want this to fail if the bundles already exist and cannot be removed.
|
# We want this to fail if the bundles already exist and cannot be removed.
|
||||||
# This is to avoid mixing bundles from different versions of the code.
|
# This is to avoid mixing bundles from different versions of the code.
|
||||||
|
|
|
@ -61,19 +61,5 @@ go build \
|
||||||
echo "Created binary: $DEST/$BINARY_FULLNAME"
|
echo "Created binary: $DEST/$BINARY_FULLNAME"
|
||||||
ln -sf "$BINARY_FULLNAME" "$DEST/docker$BINARY_EXTENSION"
|
ln -sf "$BINARY_FULLNAME" "$DEST/docker$BINARY_EXTENSION"
|
||||||
|
|
||||||
|
copy_containerd "$DEST"
|
||||||
hash_files "$DEST/$BINARY_FULLNAME"
|
hash_files "$DEST/$BINARY_FULLNAME"
|
||||||
|
|
||||||
# Add nested executables to bundle dir so we have complete set of
|
|
||||||
# them available, but only if the native OS/ARCH is the same as the
|
|
||||||
# OS/ARCH of the build target
|
|
||||||
if [ "$(go env GOOS)/$(go env GOARCH)" == "$(go env GOHOSTOS)/$(go env GOHOSTARCH)" ]; then
|
|
||||||
echo "Copying nested executables into $DEST"
|
|
||||||
(set -x
|
|
||||||
if [ -x /usr/local/bin/runc ]; then
|
|
||||||
cp /usr/local/bin/runc $DEST/
|
|
||||||
cp /usr/local/bin/ctr $DEST/
|
|
||||||
cp /usr/local/bin/containerd $DEST/
|
|
||||||
cp /usr/local/bin/containerd-shim $DEST/
|
|
||||||
fi
|
|
||||||
)
|
|
||||||
fi
|
|
||||||
|
|
|
@ -26,19 +26,5 @@ go build -compiler=gccgo \
|
||||||
echo "Created binary: $DEST/$BINARY_FULLNAME"
|
echo "Created binary: $DEST/$BINARY_FULLNAME"
|
||||||
ln -sf "$BINARY_FULLNAME" "$DEST/docker$BINARY_EXTENSION"
|
ln -sf "$BINARY_FULLNAME" "$DEST/docker$BINARY_EXTENSION"
|
||||||
|
|
||||||
|
copy_containerd "$DEST"
|
||||||
hash_files "$DEST/$BINARY_FULLNAME"
|
hash_files "$DEST/$BINARY_FULLNAME"
|
||||||
|
|
||||||
# Add nested executables to bundle dir so we have complete set of
|
|
||||||
# them available, but only if the native OS/ARCH is the same as the
|
|
||||||
# OS/ARCH of the build target
|
|
||||||
if [ "$(go env GOOS)/$(go env GOARCH)" == "$(go env GOHOSTOS)/$(go env GOHOSTARCH)" ]; then
|
|
||||||
echo "Copying nested executables into $DEST"
|
|
||||||
(set -x
|
|
||||||
if [ -x /usr/local/bin/runc ]; then
|
|
||||||
cp /usr/local/bin/runc $DEST/
|
|
||||||
cp /usr/local/bin/ctr $DEST/
|
|
||||||
cp /usr/local/bin/containerd $DEST/
|
|
||||||
cp /usr/local/bin/containerd-shim $DEST/
|
|
||||||
fi
|
|
||||||
)
|
|
||||||
fi
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue