-
-
Notifications
You must be signed in to change notification settings - Fork 44
Expand file tree
/
Copy pathDockerfile
More file actions
21 lines (17 loc) · 763 Bytes
/
Dockerfile
File metadata and controls
21 lines (17 loc) · 763 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
FROM golang:1.23-alpine3.20 AS builder
WORKDIR /go/src/github.com/TimothyYe/bing-wallpaper
COPY . .
RUN apk --no-cache add git build-base make gcc libtool musl-dev \
&& GO111MODULE=on go build -o ./bw/bw ./bw/main.go
FROM alpine
LABEL maintainer="bw"
RUN apk --no-cache add ca-certificates tzdata sqlite \
&& cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime \
&& echo "Asia/Shanghai" > /etc/timezone \
&& apk del tzdata
# See https://stackoverflow.com/questions/34729748/installed-go-binary-not-found-in-path-on-alpine-linux-docker
RUN mkdir /lib64 && ln -s /lib/libc.musl-`uname -m`.so.1 /lib64/ld-linux-`uname -m`.so.2
WORKDIR /bw
COPY --from=builder /go/src/github.com/TimothyYe/bing-wallpaper/bw/bw /bw/bw
EXPOSE 9000
ENTRYPOINT ["/bw/bw", "run"]