Browse Source

Merge pull request #21341 from duglin/tweakBuild

Add containerd/runc exes to bundle dir after build
Michael Crosby 9 years ago
parent
commit
0dcdd1c5b8
2 changed files with 30 additions and 0 deletions
  1. 15 0
      hack/make/binary
  2. 15 0
      hack/make/gccgo

+ 15 - 0
hack/make/binary

@@ -62,3 +62,18 @@ echo "Created binary: $DEST/$BINARY_FULLNAME"
 ln -sf "$BINARY_FULLNAME" "$DEST/docker$BINARY_EXTENSION"
 
 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

+ 15 - 0
hack/make/gccgo

@@ -27,3 +27,18 @@ echo "Created binary: $DEST/$BINARY_FULLNAME"
 ln -sf "$BINARY_FULLNAME" "$DEST/docker$BINARY_EXTENSION"
 
 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