فهرست منبع

Fix installation using make install

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 <gael.portay@savoirfairelinux.com>
Gaël PORTAY 8 سال پیش
والد
کامیت
425cd7d1c5
1فایلهای تغییر یافته به همراه1 افزوده شده و 0 حذف شده
  1. 1 0
      hack/make.sh

+ 1 - 0
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"