Skip to content

Commit af4105b

Browse files
committed
build: add new dockerfile for goreleaser
1 parent ef8f825 commit af4105b

2 files changed

Lines changed: 32 additions & 0 deletions

File tree

.github/goreleaser.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ dockers_v2:
3939
- images:
4040
- "0rickyy0/{{.ProjectName}}"
4141
- "ghcr.io/d-rickyy-b/{{.ProjectName}}"
42+
dockerfile: docker/Dockerfile.goreleaser
4243
tags:
4344
- "{{.Tag}}"
4445
- "{{ if not .Prerelease }}latest{{ end }}"

docker/Dockerfile.goreleaser

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
# This Dockerfile builds an image from a precompiled certstream binary.
2+
# The binary is built using goreleaser and stored in the $TARGETPLATFORM directory.
3+
FROM alpine
4+
ARG TARGETPLATFORM
5+
6+
WORKDIR /app
7+
8+
ENV USER=certstreamserver
9+
ENV UID=10001
10+
11+
# Create user
12+
RUN adduser \
13+
--disabled-password \
14+
--gecos "" \
15+
--home "/nonexistent" \
16+
--shell "/sbin/nologin" \
17+
--no-create-home \
18+
--uid "${UID}" \
19+
"${USER}"
20+
21+
# Copy our static executable.
22+
COPY $TARGETPLATFORM/certstream-server-go /app/certstream-server-go
23+
COPY ./config.docker.yaml /app/config/config.yaml
24+
RUN chown -R certstreamserver:certstreamserver /app/
25+
26+
# Use an unprivileged user.
27+
USER certstreamserver:certstreamserver
28+
29+
EXPOSE 8080
30+
31+
ENTRYPOINT ["/app/certstream-server-go", "-config", "/app/config/config.yaml"]

0 commit comments

Comments
 (0)