From 425cd7d1c5c17af5eeebc241d289d81519e748ab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ga=C3=ABl=20PORTAY?= Date: Fri, 27 Jan 2017 16:54:33 -0500 Subject: [PATCH] Fix installation using make install MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The following command fails when the target directory does not exist. $ sudo make install DOCKER_MAKE_INSTALL_PREFIX=/opt/docker AUTO_GOPATH=1 KEEPBUNDLE=1 hack/make.sh install-binary # WARNING! I don't seem to be running in a Docker container. # The result of this command might be an incorrect build, and will not be # officially supported. # # Try this instead: make all # ---> Making bundle: install-binary (in bundles/1.14.0-dev/install-binary) Installing docker to /opt/docker/bin/ cp: cannot create regular file '/opt/docker/bin/': No such file or directory make: *** [Makefile:119: install] Error 1 The patch installs the target directory before copying any binaries. $ sudo make install DOCKER_MAKE_INSTALL_PREFIX=/opt/docker AUTO_GOPATH=1 KEEPBUNDLE=1 hack/make.sh install-binary # WARNING! I don't seem to be running in a Docker container. # The result of this command might be an incorrect build, and will not be # officially supported. # # Try this instead: make all # ---> Making bundle: install-binary (in bundles/1.14.0-dev/install-binary) Installing docker to /opt/docker/bin/ Installing dockerd to /opt/docker/bin/ Installing docker-runc to /opt/docker/bin/ Installing docker-containerd to /opt/docker/bin/ Installing docker-containerd-ctr to /opt/docker/bin/ Installing docker-containerd-shim to /opt/docker/bin/ Installing docker-proxy to /opt/docker/bin/ Installing docker-init to /opt/docker/bin/ Signed-off-by: Gaƫl PORTAY --- hack/make.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/hack/make.sh b/hack/make.sh index 8b8c9aed73..ed54c620d3 100755 --- a/hack/make.sh +++ b/hack/make.sh @@ -251,6 +251,7 @@ install_binary() { target="${DOCKER_MAKE_INSTALL_PREFIX:=/usr/local}/bin/" if [ "$(go env GOOS)" == "linux" ]; then echo "Installing $(basename $file) to ${target}" + mkdir -p "$target" cp -L "$file" "$target" else echo "Install is only supported on linux"