-
Notifications
You must be signed in to change notification settings - Fork 2
/
Dockerfile
41 lines (29 loc) · 1.08 KB
/
Dockerfile
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
33
34
35
36
37
38
39
40
41
# example build:
# docker build . --build-arg=VERSION=v0.1.0 -t certwarden-client:v0.1.0
# example run
# NOTE: If you don't want or need auto container restart, you can skip mounting docker.sock
# docker run -d --name certwarden-client -e TZ=Europe/Stockholm -v /var/run/docker.sock:/var/run/docker.sock -p 5055:5055 -e [config vars here] ghcr.io/gregtwallace/certwarden-client:latest
# Versions - keep in sync with build_releases.yml
ARG ALPINE_VERSION=3.19
ARG GO_VERSION=1.22.2
# https://hub.docker.com/_/alpine
# https://hub.docker.com/_/golang
FROM golang:${GO_VERSION}-alpine${ALPINE_VERSION} AS build
ARG VERSION
WORKDIR /
RUN apk add git && \
git clone --depth 1 --branch "${VERSION}" https://github.com/gregtwallace/certwarden-client.git /src && \
cd /src && \
go build -o ./certwarden-client ./pkg/main
FROM alpine:${ALPINE_VERSION}
WORKDIR /app
# timezone support
RUN apk add --no-cache tzdata
# copy app
COPY --from=build /src/certwarden-client .
COPY ./README.md .
COPY ./CHANGELOG.md .
COPY ./LICENSE.md .
# https server
EXPOSE 5055/tcp
CMD /app/certwarden-client