Skip to content

Commit

Permalink
Makefile use --rm ("autoremove") for all targets
Browse files Browse the repository at this point in the history
These containers are stateless, so can be removed after exiting

Signed-off-by: Sebastiaan van Stijn <[email protected]>
  • Loading branch information
thaJeztah committed Jan 7, 2019
1 parent 143028e commit 872ee13
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions docker.Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -82,15 +82,15 @@ binary-osx: build_cross_image ## build the CLI for macOS

.PHONY: dev
dev: build_docker_image ## start a build container in interactive mode for in-container development
docker run -ti $(ENVVARS) $(MOUNTS) \
docker run -ti --rm $(ENVVARS) $(MOUNTS) \
-v /var/run/docker.sock:/var/run/docker.sock \
$(DEV_DOCKER_IMAGE_NAME) ash

shell: dev ## alias for dev

.PHONY: lint
lint: build_linter_image ## run linters
docker run -ti $(ENVVARS) $(MOUNTS) $(LINTER_IMAGE_NAME)
docker run -ti --rm $(ENVVARS) $(MOUNTS) $(LINTER_IMAGE_NAME)

.PHONY: fmt
fmt:
Expand Down Expand Up @@ -124,15 +124,15 @@ test-e2e: test-e2e-non-experimental test-e2e-experimental test-e2e-connhelper-ss

.PHONY: test-e2e-experimental
test-e2e-experimental: build_e2e_image
docker run -e DOCKERD_EXPERIMENTAL=1 --rm -v /var/run/docker.sock:/var/run/docker.sock $(E2E_IMAGE_NAME)
docker run --rm -v /var/run/docker.sock:/var/run/docker.sock -e DOCKERD_EXPERIMENTAL=1 $(E2E_IMAGE_NAME)

.PHONY: test-e2e-non-experimental
test-e2e-non-experimental: build_e2e_image
docker run --rm -v /var/run/docker.sock:/var/run/docker.sock $(E2E_IMAGE_NAME)

.PHONY: test-e2e-connhelper-ssh
test-e2e-connhelper-ssh: build_e2e_image
docker run -e TEST_CONNHELPER=ssh -e DOCKERD_EXPERIMENTAL=1 --rm -v /var/run/docker.sock:/var/run/docker.sock $(E2E_IMAGE_NAME)
docker run --rm -v /var/run/docker.sock:/var/run/docker.sock -e DOCKERD_EXPERIMENTAL=1 -e TEST_CONNHELPER=ssh $(E2E_IMAGE_NAME)

.PHONY: help
help: ## print this help
Expand Down

0 comments on commit 872ee13

Please sign in to comment.