Skip to content

Commit

Permalink
test: Prefetch deps and store in container image
Browse files Browse the repository at this point in the history
Signed-off-by: Mike Sul <mike.sul@foundries.io>
  • Loading branch information
mike-sul committed Sep 10, 2024
1 parent 5bc1e0f commit 0c25792
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 2 deletions.
2 changes: 2 additions & 0 deletions test/compose/.env.test
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,5 @@ INIT_SCRIPT=$CPS_DIR/init.sh

REG_DIR=$CPS_DIR/registry
REG_CERT_DIR=$REG_DIR/certs
# This must be relative to SRC_DIR path
REG_CERT=test/compose/registry/certs/registry.crt
9 changes: 8 additions & 1 deletion test/compose/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,11 @@
FROM golang:1.22-alpine

ARG REG_CERT=test/compose/registry/certs/registry.crt

RUN apk add make curl docker docker-compose git
COPY registry/certs/registry.crt /etc/ssl/certs/

COPY $REG_CERT /etc/ssl/certs/registry.crt
RUN cat /etc/ssl/certs/registry.crt >> /etc/ssl/certs/ca-certificates.crt
WORKDIR /build
COPY go.mod go.sum ./
RUN go mod download
4 changes: 3 additions & 1 deletion test/compose/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,10 @@ services:

composectl:
build:
context: ${CPS_DIR}
context: ${SRC_DIR}
dockerfile: ${CPS_DIR}/Dockerfile
args:
REG_CERT: ${REG_CERT}
volumes:
- ${SRC_DIR}:${SRC_DIR}
- ${BIN_DIR}:${SRC_DIR}/bin
Expand Down

0 comments on commit 0c25792

Please sign in to comment.