-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathDockerfile
More file actions
33 lines (23 loc) · 968 Bytes
/
Dockerfile
File metadata and controls
33 lines (23 loc) · 968 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
# syntax=docker/dockerfile:1.4
########################################
# 1) Builder: fetch Tailscale & compile pgproxy
########################################
FROM --platform=$BUILDPLATFORM cgr.dev/chainguard/go:latest-dev AS builder
# Install git in dev image so we can clone
RUN apk add --no-cache git
# Clone the exact Tailscale tag you want
ARG TAILSCALE_TAG=v1.82.5
RUN git clone --branch ${TAILSCALE_TAG} \
https://github.com/tailscale/tailscale.git /src/tailscale
WORKDIR /src/tailscale/cmd/pgproxy
# Build a fully static binary (CGO disabled) using the repo’s go.mod/go.sum
RUN CGO_ENABLED=0 go build -o /pgproxy ./
########################################
# 2) Runtime: minimal Chainguard Go image
########################################
FROM cgr.dev/chainguard/go:latest
# Copy the static pgproxy binary
COPY --from=builder /pgproxy /usr/local/bin/pgproxy
# Expose default Postgres port
EXPOSE 5432
ENTRYPOINT ["/usr/local/bin/pgproxy"]