Skip to content

Commit ecf1770

Browse files
alexluongobazoud
andauthored
chore: dockerfile.example (#505)
* fix(build): include CA certificates in Docker image (#483) Ensure the image contains trusted CA certificates so the app can establish secure HTTPS connections to AWS services. Without them, TLS handshakes fail with **x509: certificate signed by unknown authority**: `failed to check if infra exists: operation error SQS: GetQueueUrl, exceeded maximum number of attempts, 3, https response error StatusCode: 0, RequestID: , request send failed, Post "https://sqs.eu-west-1.amazonaws.com/": tls: failed to verify certificate: x509: certificate signed by unknown authority` * chore(build): Copy go mod files first to leverage Docker layer cachin… (#482) * chore(build): Copy go mod files first to leverage Docker layer caching for dependencies * chore(build): reorder WORKDIR command * chore: rename to dockerfile.example * chore: update dockerfile.example to include entrypoint.sh * chore: comment --------- Co-authored-by: Olivier Bazoud <[email protected]>
1 parent 87d7496 commit ecf1770

File tree

2 files changed

+46
-20
lines changed

2 files changed

+46
-20
lines changed

build/Dockerfile

Lines changed: 0 additions & 20 deletions
This file was deleted.

build/Dockerfile.example

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
# ⚠️ IMPORTANT: This Dockerfile is for REFERENCE ONLY and is NOT production-ready.
2+
#
3+
# We do NOT recommend using this Dockerfile in production. Instead, use the official
4+
# hookdeck/outpost image from Docker Hub:
5+
# docker pull hookdeck/outpost:latest
6+
#
7+
# The official image is optimized, regularly updated, and fully supported.
8+
#
9+
# This example is provided for educational purposes and as a starting point for
10+
# custom builds. If you need help with custom deployments, please create a
11+
# discussion at: https://github.com/hookdeck/outpost/discussions
12+
13+
# Stage 0
14+
# Build the binaries
15+
FROM golang:1.23-alpine
16+
WORKDIR /app
17+
COPY go.mod go.sum ./
18+
RUN go mod download
19+
COPY . .
20+
21+
# Build all binaries
22+
RUN go build -o ./bin/outpost ./cmd/outpost/main.go && \
23+
go build -o ./bin/outpost-server ./cmd/outpost-server/main.go && \
24+
go build -o ./bin/outpost-migrate-redis ./cmd/outpost-migrate-redis/main.go
25+
26+
# Stage 1
27+
# Get busybox shell for entrypoint script
28+
FROM busybox:1.36-musl AS busybox
29+
30+
# Stage 2
31+
# Copy binaries to a new image
32+
FROM gcr.io/distroless/base-debian12:nonroot
33+
34+
# Copy statically linked shell from busybox for entrypoint script
35+
COPY --from=busybox /bin/sh /bin/sh
36+
37+
# Copy all binaries
38+
COPY --from=0 /app/bin/outpost /usr/local/bin/outpost
39+
COPY --from=0 /app/bin/outpost-server /usr/local/bin/outpost-server
40+
COPY --from=0 /app/bin/outpost-migrate-redis /usr/local/bin/outpost-migrate-redis
41+
42+
# Copy entrypoint script
43+
COPY --from=0 /app/build/entrypoint.sh /usr/local/bin/entrypoint.sh
44+
45+
# Default entrypoint runs migrations and starts server
46+
ENTRYPOINT ["/bin/sh", "/usr/local/bin/entrypoint.sh"]

0 commit comments

Comments
 (0)