cli/docker.Makefile

157 строки
6.2 KiB
Plaintext
Исходник Обычный вид История

#
# github.com/docker/cli
#
# Makefile for developing using Docker
#
# Overridable env vars
DOCKER_CLI_MOUNTS ?= -v "$(CURDIR)":/go/src/github.com/docker/cli
DOCKER_CLI_SHELL ?= ash
DOCKER_CLI_CONTAINER_NAME ?=
DOCKER_CLI_GO_BUILD_CACHE ?= y
DEV_DOCKER_IMAGE_NAME = docker-cli-dev$(IMAGE_TAG)
BINARY_NATIVE_IMAGE_NAME = docker-cli-native$(IMAGE_TAG)
LINTER_IMAGE_NAME = docker-cli-lint$(IMAGE_TAG)
CROSS_IMAGE_NAME = docker-cli-cross$(IMAGE_TAG)
VALIDATE_IMAGE_NAME = docker-cli-shell-validate$(IMAGE_TAG)
E2E_IMAGE_NAME = docker-cli-e2e$(IMAGE_TAG)
CACHE_VOLUME_NAME := docker-cli-dev-cache
ifeq ($(DOCKER_CLI_GO_BUILD_CACHE),y)
DOCKER_CLI_MOUNTS += -v "$(CACHE_VOLUME_NAME):/root/.cache/go-build"
endif
VERSION = $(shell cat VERSION)
ENVVARS = -e VERSION=$(VERSION) -e GITCOMMIT -e PLATFORM -e TESTFLAGS -e TESTDIRS -e GOOS -e GOARCH -e GOARM
# build docker image (dockerfiles/Dockerfile.build)
.PHONY: build_docker_image
build_docker_image:
Do not patch Dockerfiles in CI When building the Dockerfiles for development, those images are mainly used to create a reproducible build-environment. The source code is bind-mounted into the image at runtime; there is no need to create an image with the actual source code, and copying the source code into the image would lead to a new image being created for each code-change (possibly leading up to many "dangling" images for previous code-changes). However, when building (and using) the development images in CI, bind-mounting is not an option, because the daemon is running remotely. To make this work, the circle-ci script patched the Dockerfiles when CI is run; adding a `COPY` to the respective Dockerfiles. Patching Dockerfiles is not really a "best practice" and, even though the source code does not and up in the image, the source would still be _sent_ to the daemon for each build (unless BuildKit is used). This patch updates the makefiles, circle-ci script, and Dockerfiles; - When building the Dockerfiles locally, pipe the Dockerfile through stdin. Doing so, prevents the build-context from being sent to the daemon. This speeds up the build, and doesn't fill up the Docker "temp" directory with content that's not used - Now that no content is sent, add the COPY instructions to the Dockerfiles, and remove the code in the circle-ci script to "live patch" the Dockerfiles. Before this patch is applied (with cache): ``` $ time make -f docker.Makefile build_shell_validate_image docker build -t docker-cli-shell-validate -f ./dockerfiles/Dockerfile.shellcheck . Sending build context to Docker daemon 41MB Step 1/2 : FROM debian:stretch-slim ... Successfully built 81e14e8ad856 Successfully tagged docker-cli-shell-validate:latest 2.75 real 0.45 user 0.56 sys ``` After this patch is applied (with cache):: ``` $ time make -f docker.Makefile build_shell_validate_image cat ./dockerfiles/Dockerfile.shellcheck | docker build -t docker-cli-shell-validate - Sending build context to Docker daemon 2.048kB Step 1/2 : FROM debian:stretch-slim ... Successfully built 81e14e8ad856 Successfully tagged docker-cli-shell-validate:latest 0.33 real 0.07 user 0.08 sys ``` Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2018-11-29 03:06:10 +03:00
# build dockerfile from stdin so that we don't send the build-context; source is bind-mounted in the development environment
cat ./dockerfiles/Dockerfile.dev | docker build ${DOCKER_BUILD_ARGS} -t $(DEV_DOCKER_IMAGE_NAME) -
# build docker image having the linting tools (dockerfiles/Dockerfile.lint)
.PHONY: build_linter_image
build_linter_image:
Do not patch Dockerfiles in CI When building the Dockerfiles for development, those images are mainly used to create a reproducible build-environment. The source code is bind-mounted into the image at runtime; there is no need to create an image with the actual source code, and copying the source code into the image would lead to a new image being created for each code-change (possibly leading up to many "dangling" images for previous code-changes). However, when building (and using) the development images in CI, bind-mounting is not an option, because the daemon is running remotely. To make this work, the circle-ci script patched the Dockerfiles when CI is run; adding a `COPY` to the respective Dockerfiles. Patching Dockerfiles is not really a "best practice" and, even though the source code does not and up in the image, the source would still be _sent_ to the daemon for each build (unless BuildKit is used). This patch updates the makefiles, circle-ci script, and Dockerfiles; - When building the Dockerfiles locally, pipe the Dockerfile through stdin. Doing so, prevents the build-context from being sent to the daemon. This speeds up the build, and doesn't fill up the Docker "temp" directory with content that's not used - Now that no content is sent, add the COPY instructions to the Dockerfiles, and remove the code in the circle-ci script to "live patch" the Dockerfiles. Before this patch is applied (with cache): ``` $ time make -f docker.Makefile build_shell_validate_image docker build -t docker-cli-shell-validate -f ./dockerfiles/Dockerfile.shellcheck . Sending build context to Docker daemon 41MB Step 1/2 : FROM debian:stretch-slim ... Successfully built 81e14e8ad856 Successfully tagged docker-cli-shell-validate:latest 2.75 real 0.45 user 0.56 sys ``` After this patch is applied (with cache):: ``` $ time make -f docker.Makefile build_shell_validate_image cat ./dockerfiles/Dockerfile.shellcheck | docker build -t docker-cli-shell-validate - Sending build context to Docker daemon 2.048kB Step 1/2 : FROM debian:stretch-slim ... Successfully built 81e14e8ad856 Successfully tagged docker-cli-shell-validate:latest 0.33 real 0.07 user 0.08 sys ``` Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2018-11-29 03:06:10 +03:00
# build dockerfile from stdin so that we don't send the build-context; source is bind-mounted in the development environment
cat ./dockerfiles/Dockerfile.lint | docker build ${DOCKER_BUILD_ARGS} -t $(LINTER_IMAGE_NAME) -
.PHONY: build_cross_image
build_cross_image:
Do not patch Dockerfiles in CI When building the Dockerfiles for development, those images are mainly used to create a reproducible build-environment. The source code is bind-mounted into the image at runtime; there is no need to create an image with the actual source code, and copying the source code into the image would lead to a new image being created for each code-change (possibly leading up to many "dangling" images for previous code-changes). However, when building (and using) the development images in CI, bind-mounting is not an option, because the daemon is running remotely. To make this work, the circle-ci script patched the Dockerfiles when CI is run; adding a `COPY` to the respective Dockerfiles. Patching Dockerfiles is not really a "best practice" and, even though the source code does not and up in the image, the source would still be _sent_ to the daemon for each build (unless BuildKit is used). This patch updates the makefiles, circle-ci script, and Dockerfiles; - When building the Dockerfiles locally, pipe the Dockerfile through stdin. Doing so, prevents the build-context from being sent to the daemon. This speeds up the build, and doesn't fill up the Docker "temp" directory with content that's not used - Now that no content is sent, add the COPY instructions to the Dockerfiles, and remove the code in the circle-ci script to "live patch" the Dockerfiles. Before this patch is applied (with cache): ``` $ time make -f docker.Makefile build_shell_validate_image docker build -t docker-cli-shell-validate -f ./dockerfiles/Dockerfile.shellcheck . Sending build context to Docker daemon 41MB Step 1/2 : FROM debian:stretch-slim ... Successfully built 81e14e8ad856 Successfully tagged docker-cli-shell-validate:latest 2.75 real 0.45 user 0.56 sys ``` After this patch is applied (with cache):: ``` $ time make -f docker.Makefile build_shell_validate_image cat ./dockerfiles/Dockerfile.shellcheck | docker build -t docker-cli-shell-validate - Sending build context to Docker daemon 2.048kB Step 1/2 : FROM debian:stretch-slim ... Successfully built 81e14e8ad856 Successfully tagged docker-cli-shell-validate:latest 0.33 real 0.07 user 0.08 sys ``` Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2018-11-29 03:06:10 +03:00
# build dockerfile from stdin so that we don't send the build-context; source is bind-mounted in the development environment
cat ./dockerfiles/Dockerfile.cross | docker build ${DOCKER_BUILD_ARGS} -t $(CROSS_IMAGE_NAME) -
.PHONY: build_shell_validate_image
build_shell_validate_image:
Do not patch Dockerfiles in CI When building the Dockerfiles for development, those images are mainly used to create a reproducible build-environment. The source code is bind-mounted into the image at runtime; there is no need to create an image with the actual source code, and copying the source code into the image would lead to a new image being created for each code-change (possibly leading up to many "dangling" images for previous code-changes). However, when building (and using) the development images in CI, bind-mounting is not an option, because the daemon is running remotely. To make this work, the circle-ci script patched the Dockerfiles when CI is run; adding a `COPY` to the respective Dockerfiles. Patching Dockerfiles is not really a "best practice" and, even though the source code does not and up in the image, the source would still be _sent_ to the daemon for each build (unless BuildKit is used). This patch updates the makefiles, circle-ci script, and Dockerfiles; - When building the Dockerfiles locally, pipe the Dockerfile through stdin. Doing so, prevents the build-context from being sent to the daemon. This speeds up the build, and doesn't fill up the Docker "temp" directory with content that's not used - Now that no content is sent, add the COPY instructions to the Dockerfiles, and remove the code in the circle-ci script to "live patch" the Dockerfiles. Before this patch is applied (with cache): ``` $ time make -f docker.Makefile build_shell_validate_image docker build -t docker-cli-shell-validate -f ./dockerfiles/Dockerfile.shellcheck . Sending build context to Docker daemon 41MB Step 1/2 : FROM debian:stretch-slim ... Successfully built 81e14e8ad856 Successfully tagged docker-cli-shell-validate:latest 2.75 real 0.45 user 0.56 sys ``` After this patch is applied (with cache):: ``` $ time make -f docker.Makefile build_shell_validate_image cat ./dockerfiles/Dockerfile.shellcheck | docker build -t docker-cli-shell-validate - Sending build context to Docker daemon 2.048kB Step 1/2 : FROM debian:stretch-slim ... Successfully built 81e14e8ad856 Successfully tagged docker-cli-shell-validate:latest 0.33 real 0.07 user 0.08 sys ``` Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2018-11-29 03:06:10 +03:00
# build dockerfile from stdin so that we don't send the build-context; source is bind-mounted in the development environment
cat ./dockerfiles/Dockerfile.shellcheck | docker build -t $(VALIDATE_IMAGE_NAME) -
.PHONY: build_binary_native_image
build_binary_native_image:
Do not patch Dockerfiles in CI When building the Dockerfiles for development, those images are mainly used to create a reproducible build-environment. The source code is bind-mounted into the image at runtime; there is no need to create an image with the actual source code, and copying the source code into the image would lead to a new image being created for each code-change (possibly leading up to many "dangling" images for previous code-changes). However, when building (and using) the development images in CI, bind-mounting is not an option, because the daemon is running remotely. To make this work, the circle-ci script patched the Dockerfiles when CI is run; adding a `COPY` to the respective Dockerfiles. Patching Dockerfiles is not really a "best practice" and, even though the source code does not and up in the image, the source would still be _sent_ to the daemon for each build (unless BuildKit is used). This patch updates the makefiles, circle-ci script, and Dockerfiles; - When building the Dockerfiles locally, pipe the Dockerfile through stdin. Doing so, prevents the build-context from being sent to the daemon. This speeds up the build, and doesn't fill up the Docker "temp" directory with content that's not used - Now that no content is sent, add the COPY instructions to the Dockerfiles, and remove the code in the circle-ci script to "live patch" the Dockerfiles. Before this patch is applied (with cache): ``` $ time make -f docker.Makefile build_shell_validate_image docker build -t docker-cli-shell-validate -f ./dockerfiles/Dockerfile.shellcheck . Sending build context to Docker daemon 41MB Step 1/2 : FROM debian:stretch-slim ... Successfully built 81e14e8ad856 Successfully tagged docker-cli-shell-validate:latest 2.75 real 0.45 user 0.56 sys ``` After this patch is applied (with cache):: ``` $ time make -f docker.Makefile build_shell_validate_image cat ./dockerfiles/Dockerfile.shellcheck | docker build -t docker-cli-shell-validate - Sending build context to Docker daemon 2.048kB Step 1/2 : FROM debian:stretch-slim ... Successfully built 81e14e8ad856 Successfully tagged docker-cli-shell-validate:latest 0.33 real 0.07 user 0.08 sys ``` Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2018-11-29 03:06:10 +03:00
# build dockerfile from stdin so that we don't send the build-context; source is bind-mounted in the development environment
cat ./dockerfiles/Dockerfile.binary-native | docker build -t $(BINARY_NATIVE_IMAGE_NAME) -
.PHONY: build_e2e_image
build_e2e_image:
docker build -t $(E2E_IMAGE_NAME) --build-arg VERSION=$(VERSION) --build-arg GITCOMMIT=$(GITCOMMIT) -f ./dockerfiles/Dockerfile.e2e .
DOCKER_RUN_NAME_OPTION := $(if $(DOCKER_CLI_CONTAINER_NAME),--name $(DOCKER_CLI_CONTAINER_NAME),)
DOCKER_RUN := docker run --rm $(ENVVARS) $(DOCKER_CLI_MOUNTS) $(DOCKER_RUN_NAME_OPTION)
binary: build_binary_native_image ## build the CLI
$(DOCKER_RUN) $(BINARY_NATIVE_IMAGE_NAME)
build: binary ## alias for binary
plugins: build_binary_native_image ## build the CLI plugin examples
$(DOCKER_RUN) $(BINARY_NATIVE_IMAGE_NAME) ./scripts/build/plugins
.PHONY: clean
clean: build_docker_image ## clean build artifacts
$(DOCKER_RUN) $(DEV_DOCKER_IMAGE_NAME) make clean
docker volume rm -f $(CACHE_VOLUME_NAME)
.PHONY: test-unit
Fix some missing targets in "make help" The `make help` output was missing some targets (`fmt`, `test-unit`, `test-e2e`). Note that some targets are still hidden (`test-e2e-experimental`, `test-e2e-non-experimental`, `test-e2e-connhelper-ssh`) as they're likely not usually run separate from `test-e2e`. Before this patch: make -f docker.Makefile help binary build the CLI build alias for binary clean clean build artifacts cross build the CLI for macOS and Windows binary-windows build the CLI for Windows binary-osx build the CLI for macOS dev start a build container in interactive mode for in-container development shell alias for dev lint run linters vendor download dependencies (vendor/) listed in vendor.conf dynbinary build the CLI dynamically linked authors generate AUTHORS file from git history manpages generate man pages from go source and markdown yamldocs generate documentation YAML files consumed by docs repo shellcheck run shellcheck validation help print this help With this patch applied: make -f docker.Makefile help binary build the CLI build alias for binary clean clean build artifacts test-unit run unit tests (using go test) cross build the CLI for macOS and Windows binary-windows build the CLI for Windows binary-osx build the CLI for macOS dev start a build container in interactive mode for in-container development shell alias for dev lint run linters fmt run gofmt vendor download dependencies (vendor/) listed in vendor.conf dynbinary build the CLI dynamically linked authors generate AUTHORS file from git history manpages generate man pages from go source and markdown yamldocs generate documentation YAML files consumed by docs repo shellcheck run shellcheck validation test-e2e run all e2e tests help print this help Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2019-01-07 19:32:56 +03:00
test-unit: build_docker_image ## run unit tests (using go test)
$(DOCKER_RUN) $(DEV_DOCKER_IMAGE_NAME) make test-unit
.PHONY: test ## run unit and e2e tests
test: test-unit test-e2e
.PHONY: cross
cross: build_cross_image ## build the CLI for macOS and Windows
$(DOCKER_RUN) $(CROSS_IMAGE_NAME) make cross
.PHONY: binary-windows
binary-windows: build_cross_image ## build the CLI for Windows
$(DOCKER_RUN) $(CROSS_IMAGE_NAME) make $@
.PHONY: plugins-windows
plugins-windows: build_cross_image ## build the example CLI plugins for Windows
$(DOCKER_RUN) $(CROSS_IMAGE_NAME) make $@
.PHONY: binary-osx
binary-osx: build_cross_image ## build the CLI for macOS
$(DOCKER_RUN) $(CROSS_IMAGE_NAME) make $@
.PHONY: plugins-osx
plugins-osx: build_cross_image ## build the example CLI plugins for macOS
$(DOCKER_RUN) $(CROSS_IMAGE_NAME) make $@
.PHONY: dev
dev: build_docker_image ## start a build container in interactive mode for in-container development
$(DOCKER_RUN) -it \
-v /var/run/docker.sock:/var/run/docker.sock \
$(DEV_DOCKER_IMAGE_NAME) $(DOCKER_CLI_SHELL)
shell: dev ## alias for dev
.PHONY: lint
lint: build_linter_image ## run linters
$(DOCKER_RUN) -it $(LINTER_IMAGE_NAME)
.PHONY: fmt
Fix some missing targets in "make help" The `make help` output was missing some targets (`fmt`, `test-unit`, `test-e2e`). Note that some targets are still hidden (`test-e2e-experimental`, `test-e2e-non-experimental`, `test-e2e-connhelper-ssh`) as they're likely not usually run separate from `test-e2e`. Before this patch: make -f docker.Makefile help binary build the CLI build alias for binary clean clean build artifacts cross build the CLI for macOS and Windows binary-windows build the CLI for Windows binary-osx build the CLI for macOS dev start a build container in interactive mode for in-container development shell alias for dev lint run linters vendor download dependencies (vendor/) listed in vendor.conf dynbinary build the CLI dynamically linked authors generate AUTHORS file from git history manpages generate man pages from go source and markdown yamldocs generate documentation YAML files consumed by docs repo shellcheck run shellcheck validation help print this help With this patch applied: make -f docker.Makefile help binary build the CLI build alias for binary clean clean build artifacts test-unit run unit tests (using go test) cross build the CLI for macOS and Windows binary-windows build the CLI for Windows binary-osx build the CLI for macOS dev start a build container in interactive mode for in-container development shell alias for dev lint run linters fmt run gofmt vendor download dependencies (vendor/) listed in vendor.conf dynbinary build the CLI dynamically linked authors generate AUTHORS file from git history manpages generate man pages from go source and markdown yamldocs generate documentation YAML files consumed by docs repo shellcheck run shellcheck validation test-e2e run all e2e tests help print this help Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2019-01-07 19:32:56 +03:00
fmt: ## run gofmt
$(DOCKER_RUN) $(DEV_DOCKER_IMAGE_NAME) make fmt
.PHONY: vendor
vendor: build_docker_image vendor.conf ## download dependencies (vendor/) listed in vendor.conf
$(DOCKER_RUN) -it $(DEV_DOCKER_IMAGE_NAME) make vendor
dynbinary: build_cross_image ## build the CLI dynamically linked
$(DOCKER_RUN) -it $(CROSS_IMAGE_NAME) make dynbinary
.PHONY: authors
authors: ## generate AUTHORS file from git history
$(DOCKER_RUN) -it $(DEV_DOCKER_IMAGE_NAME) make authors
.PHONY: manpages
manpages: build_docker_image ## generate man pages from go source and markdown
$(DOCKER_RUN) -it $(DEV_DOCKER_IMAGE_NAME) make manpages
.PHONY: yamldocs
yamldocs: build_docker_image ## generate documentation YAML files consumed by docs repo
$(DOCKER_RUN) -it $(DEV_DOCKER_IMAGE_NAME) make yamldocs
.PHONY: shellcheck
shellcheck: build_shell_validate_image ## run shellcheck validation
$(DOCKER_RUN) -it $(VALIDATE_IMAGE_NAME) make shellcheck
Fix some missing targets in "make help" The `make help` output was missing some targets (`fmt`, `test-unit`, `test-e2e`). Note that some targets are still hidden (`test-e2e-experimental`, `test-e2e-non-experimental`, `test-e2e-connhelper-ssh`) as they're likely not usually run separate from `test-e2e`. Before this patch: make -f docker.Makefile help binary build the CLI build alias for binary clean clean build artifacts cross build the CLI for macOS and Windows binary-windows build the CLI for Windows binary-osx build the CLI for macOS dev start a build container in interactive mode for in-container development shell alias for dev lint run linters vendor download dependencies (vendor/) listed in vendor.conf dynbinary build the CLI dynamically linked authors generate AUTHORS file from git history manpages generate man pages from go source and markdown yamldocs generate documentation YAML files consumed by docs repo shellcheck run shellcheck validation help print this help With this patch applied: make -f docker.Makefile help binary build the CLI build alias for binary clean clean build artifacts test-unit run unit tests (using go test) cross build the CLI for macOS and Windows binary-windows build the CLI for Windows binary-osx build the CLI for macOS dev start a build container in interactive mode for in-container development shell alias for dev lint run linters fmt run gofmt vendor download dependencies (vendor/) listed in vendor.conf dynbinary build the CLI dynamically linked authors generate AUTHORS file from git history manpages generate man pages from go source and markdown yamldocs generate documentation YAML files consumed by docs repo shellcheck run shellcheck validation test-e2e run all e2e tests help print this help Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2019-01-07 19:32:56 +03:00
.PHONY: test-e2e
test-e2e: test-e2e-non-experimental test-e2e-experimental test-e2e-connhelper-ssh ## run all e2e tests
.PHONY: test-e2e-experimental
Fix some missing targets in "make help" The `make help` output was missing some targets (`fmt`, `test-unit`, `test-e2e`). Note that some targets are still hidden (`test-e2e-experimental`, `test-e2e-non-experimental`, `test-e2e-connhelper-ssh`) as they're likely not usually run separate from `test-e2e`. Before this patch: make -f docker.Makefile help binary build the CLI build alias for binary clean clean build artifacts cross build the CLI for macOS and Windows binary-windows build the CLI for Windows binary-osx build the CLI for macOS dev start a build container in interactive mode for in-container development shell alias for dev lint run linters vendor download dependencies (vendor/) listed in vendor.conf dynbinary build the CLI dynamically linked authors generate AUTHORS file from git history manpages generate man pages from go source and markdown yamldocs generate documentation YAML files consumed by docs repo shellcheck run shellcheck validation help print this help With this patch applied: make -f docker.Makefile help binary build the CLI build alias for binary clean clean build artifacts test-unit run unit tests (using go test) cross build the CLI for macOS and Windows binary-windows build the CLI for Windows binary-osx build the CLI for macOS dev start a build container in interactive mode for in-container development shell alias for dev lint run linters fmt run gofmt vendor download dependencies (vendor/) listed in vendor.conf dynbinary build the CLI dynamically linked authors generate AUTHORS file from git history manpages generate man pages from go source and markdown yamldocs generate documentation YAML files consumed by docs repo shellcheck run shellcheck validation test-e2e run all e2e tests help print this help Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2019-01-07 19:32:56 +03:00
test-e2e-experimental: build_e2e_image # run experimental e2e tests
docker run --rm -v /var/run/docker.sock:/var/run/docker.sock $(ENVVARS) -e DOCKERD_EXPERIMENTAL=1 $(E2E_IMAGE_NAME)
.PHONY: test-e2e-non-experimental
Fix some missing targets in "make help" The `make help` output was missing some targets (`fmt`, `test-unit`, `test-e2e`). Note that some targets are still hidden (`test-e2e-experimental`, `test-e2e-non-experimental`, `test-e2e-connhelper-ssh`) as they're likely not usually run separate from `test-e2e`. Before this patch: make -f docker.Makefile help binary build the CLI build alias for binary clean clean build artifacts cross build the CLI for macOS and Windows binary-windows build the CLI for Windows binary-osx build the CLI for macOS dev start a build container in interactive mode for in-container development shell alias for dev lint run linters vendor download dependencies (vendor/) listed in vendor.conf dynbinary build the CLI dynamically linked authors generate AUTHORS file from git history manpages generate man pages from go source and markdown yamldocs generate documentation YAML files consumed by docs repo shellcheck run shellcheck validation help print this help With this patch applied: make -f docker.Makefile help binary build the CLI build alias for binary clean clean build artifacts test-unit run unit tests (using go test) cross build the CLI for macOS and Windows binary-windows build the CLI for Windows binary-osx build the CLI for macOS dev start a build container in interactive mode for in-container development shell alias for dev lint run linters fmt run gofmt vendor download dependencies (vendor/) listed in vendor.conf dynbinary build the CLI dynamically linked authors generate AUTHORS file from git history manpages generate man pages from go source and markdown yamldocs generate documentation YAML files consumed by docs repo shellcheck run shellcheck validation test-e2e run all e2e tests help print this help Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2019-01-07 19:32:56 +03:00
test-e2e-non-experimental: build_e2e_image # run non-experimental e2e tests
docker run --rm -v /var/run/docker.sock:/var/run/docker.sock $(ENVVARS) $(E2E_IMAGE_NAME)
.PHONY: test-e2e-connhelper-ssh
Fix some missing targets in "make help" The `make help` output was missing some targets (`fmt`, `test-unit`, `test-e2e`). Note that some targets are still hidden (`test-e2e-experimental`, `test-e2e-non-experimental`, `test-e2e-connhelper-ssh`) as they're likely not usually run separate from `test-e2e`. Before this patch: make -f docker.Makefile help binary build the CLI build alias for binary clean clean build artifacts cross build the CLI for macOS and Windows binary-windows build the CLI for Windows binary-osx build the CLI for macOS dev start a build container in interactive mode for in-container development shell alias for dev lint run linters vendor download dependencies (vendor/) listed in vendor.conf dynbinary build the CLI dynamically linked authors generate AUTHORS file from git history manpages generate man pages from go source and markdown yamldocs generate documentation YAML files consumed by docs repo shellcheck run shellcheck validation help print this help With this patch applied: make -f docker.Makefile help binary build the CLI build alias for binary clean clean build artifacts test-unit run unit tests (using go test) cross build the CLI for macOS and Windows binary-windows build the CLI for Windows binary-osx build the CLI for macOS dev start a build container in interactive mode for in-container development shell alias for dev lint run linters fmt run gofmt vendor download dependencies (vendor/) listed in vendor.conf dynbinary build the CLI dynamically linked authors generate AUTHORS file from git history manpages generate man pages from go source and markdown yamldocs generate documentation YAML files consumed by docs repo shellcheck run shellcheck validation test-e2e run all e2e tests help print this help Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2019-01-07 19:32:56 +03:00
test-e2e-connhelper-ssh: build_e2e_image # run experimental SSH-connection helper e2e tests
docker run --rm -v /var/run/docker.sock:/var/run/docker.sock $(ENVVARS) -e DOCKERD_EXPERIMENTAL=1 -e TEST_CONNHELPER=ssh $(E2E_IMAGE_NAME)
.PHONY: help
help: ## print this help
@awk 'BEGIN {FS = ":.*?## "} /^[a-zA-Z0-9_-]+:.*?## / {gsub("\\\\n",sprintf("\n%22c",""), $$2);printf "\033[36m%-20s\033[0m %s\n", $$1, $$2}' $(MAKEFILE_LIST)