Merge pull request #13923 from hashicorp/docs-website-via-podman

website: enable setting custom tool for launching website dev container
This commit is contained in:
Seth Hoenig 2022-07-26 10:40:10 -05:00 committed by GitHub
commit 55428f4a04
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1,5 +1,8 @@
.DEFAULT_GOAL := website .DEFAULT_GOAL := website
# Enable setting alternate docker tool, e.g. 'make DOCKER_CMD=podman'
DOCKER_CMD ?= docker
PWD=$$(pwd) PWD=$$(pwd)
DOCKER_IMAGE="hashicorp/dev-portal" DOCKER_IMAGE="hashicorp/dev-portal"
DOCKER_IMAGE_LOCAL="dev-portal-local" DOCKER_IMAGE_LOCAL="dev-portal-local"
@ -19,20 +22,20 @@ DOCKER_RUN_FLAGS=-it \
.PHONY: website .PHONY: website
website: website:
@echo "==> Downloading latest Docker image..." @echo "==> Downloading latest Docker image..."
@docker pull $(DOCKER_IMAGE) @$(DOCKER_CMD) pull $(DOCKER_IMAGE)
@echo "==> Starting website..." @echo "==> Starting website..."
@docker run $(DOCKER_RUN_FLAGS) $(DOCKER_IMAGE) @$(DOCKER_CMD) run $(DOCKER_RUN_FLAGS) $(DOCKER_IMAGE)
# Use this if you have run `website/build-local` to use the locally built image. # Use this if you have run `website/build-local` to use the locally built image.
.PHONY: website/local .PHONY: website/local
website/local: website/local:
@echo "==> Starting website from local image..." @echo "==> Starting website from local image..."
@docker run $(DOCKER_RUN_FLAGS) $(DOCKER_IMAGE_LOCAL) @$(DOCKER_CMD) run $(DOCKER_RUN_FLAGS) $(DOCKER_IMAGE_LOCAL)
# Run this to generate a new local Docker image. # Run this to generate a new local Docker image.
.PHONY: website/build-local .PHONY: website/build-local
website/build-local: website/build-local:
@echo "==> Building local Docker image" @echo "==> Building local Docker image"
@docker build https://github.com/hashicorp/dev-portal.git\#main \ @$(DOCKER_CMD) build https://github.com/hashicorp/dev-portal.git\#main \
-t $(DOCKER_IMAGE_LOCAL) -t $(DOCKER_IMAGE_LOCAL)