Skip to content

Commit 9be6b19

Browse files
authored
Make docker build pass oauth flags (#169)
Signed-off-by: Jose Fuentes <[email protected]>
1 parent 59ef4a2 commit 9be6b19

File tree

2 files changed

+14
-2
lines changed

2 files changed

+14
-2
lines changed

Dockerfile

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,15 @@ RUN go mod download
1212

1313
## Bring in everything else and build an amd64 image
1414
COPY . .
15-
RUN make install
15+
16+
ARG oauth_client_id
17+
ARG oauth_client_secret
18+
ARG oauth_auth_server_domain
19+
20+
RUN make install \
21+
OAUTH_CLIENT_ID=${oauth_client_id} \
22+
OAUTH_CLIENT_SECRET=${oauth_client_secret} \
23+
OAUTH_AUTH_SERVER_DOMAIN=${oauth_auth_server_domain}
1624

1725
# STAGE 2
1826
# Use a distroless nonroot base image for just our executable

Makefile

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,11 @@ bundle-all-platforms:
7878
# Docker image
7979

8080
build-docker-image:
81-
docker build --tag $(DOCKER_IMAGE_TAG) .
81+
docker build --tag $(DOCKER_IMAGE_TAG) \
82+
--build-arg oauth_client_id=$(OAUTH_CLIENT_ID) \
83+
--build-arg oauth_client_secret=$(OAUTH_CLIENT_SECRET) \
84+
--build-arg oauth_auth_server_domain=$(OAUTH_AUTH_SERVER_DOMAIN) \
85+
.
8286

8387
push-docker-image:
8488
docker tag $(DOCKER_IMAGE_TAG) $(DOCKER_IMAGE):latest

0 commit comments

Comments
 (0)