diff --git a/Makefile b/Makefile index 1bf713acbce..da4ee1416af 100644 --- a/Makefile +++ b/Makefile @@ -7,6 +7,8 @@ LDFLAGS="-X $(PKG).version=$(VERSION) -X $(PKG).commit=$(COMMIT) -X $(PKG).date= .DEFAULT_GOAL := build +CONTAINER ?= docker + .PHONY: all all: test cover fmt lint build generate @@ -92,8 +94,8 @@ generate: .PHONY: container container: check-docker-tool-check - docker build -f dockerfiles/Dockerfile.guac-cont -t local-organic-guac . - docker build -f dockerfiles/Dockerfile.healthcheck -t local-healthcheck . + $(CONTAINER) build -f dockerfiles/Dockerfile.guac-cont -t local-organic-guac . + $(CONTAINER) build -f dockerfiles/Dockerfile.healthcheck -t local-healthcheck . # To run the service, run `make container` and then `make service` @@ -104,17 +106,17 @@ start-service: # not handle that well. # # if container images are missing, run `make container` first - docker compose up --force-recreate + $(CONTAINER) compose up --force-recreate # to flush state, service-stop must be used else state is taken from old containers .PHONY: stop-service stop-service: - docker compose down + $(CONTAINER) compose down .PHONY: check-docker-tool-check check-docker-tool-check: - @if ! command -v docker &> /dev/null; then \ - echo "Docker is not installed. Please install Docker and try again."; \ + @if ! command -v $(CONTAINER) &> /dev/null; then \ + echo "'$(CONTAINER)' is not installed. Please install '$(CONTAINER)' and try again. Or set the CONTAINER variable to a different container runtime engine."; \ exit 1; \ fi diff --git a/dockerfiles/Dockerfile.guac-cont b/dockerfiles/Dockerfile.guac-cont index 4a96b62ed09..51b7e7309b5 100644 --- a/dockerfiles/Dockerfile.guac-cont +++ b/dockerfiles/Dockerfile.guac-cont @@ -1,9 +1,9 @@ -FROM golang:1.19 as builder +FROM docker.io/library/golang:1.19 as builder ADD . /go/src/github.com/guacsec/guac/ WORKDIR /go/src/github.com/guacsec/guac/ RUN rm -rf bin/ && make build -FROM ubuntu:22.04 +FROM docker.io/library/ubuntu:22.04 RUN apt update RUN apt install -y ca-certificates WORKDIR /root