Skip to content

Commit dc4e516

Browse files
committed
Update Dockerfile's Go & Alpine versions
Update Go to 1.22 and Alpine to 3.20 and change Dockerfile accordingly. Add `go build` command. Run chmod on /go/src/github.com/andreimarcu/linx-server to make static & templates directories readable by the server (only needed when image is built with UMASK=0027).
1 parent c8f7c32 commit dc4e516

1 file changed

Lines changed: 6 additions & 4 deletions

File tree

Dockerfile

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
1-
FROM golang:1.14-alpine3.11 AS build
1+
FROM golang:1.22-alpine3.20 AS build
22

33
COPY . /go/src/github.com/andreimarcu/linx-server
44
WORKDIR /go/src/github.com/andreimarcu/linx-server
55

66
RUN set -ex \
77
&& apk add --no-cache --virtual .build-deps git \
8-
&& go get -v . \
8+
&& go install -v . \
99
&& apk del .build-deps
1010

11-
FROM alpine:3.11
11+
FROM alpine:3.20
1212

1313
COPY --from=build /go/bin/linx-server /usr/local/bin/linx-server
1414

@@ -18,7 +18,9 @@ ENV SSL_CERT_FILE /etc/ssl/cert.pem
1818
COPY static /go/src/github.com/andreimarcu/linx-server/static/
1919
COPY templates /go/src/github.com/andreimarcu/linx-server/templates/
2020

21-
RUN mkdir -p /data/files && mkdir -p /data/meta && mkdir -p /data/locks && chown -R 65534:65534 /data
21+
RUN mkdir -p /data/files /data/meta /data/locks \
22+
&& chown -R 65534:65534 /data \
23+
&& chmod -R u=rwX,go=rX /go/src/github.com/andreimarcu/linx-server
2224

2325
VOLUME ["/data/files", "/data/meta", "/data/locks"]
2426

0 commit comments

Comments
 (0)