Skip to content

Commit 1db9a4b

Browse files
committed
chore: refine docker file
1 parent 21ddb99 commit 1db9a4b

File tree

1 file changed

+9
-12
lines changed

1 file changed

+9
-12
lines changed
Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,10 @@
11
FROM golang:alpine AS builder
2-
COPY *.go /go/src/mjpclab.dev/ghfs/
3-
COPY .git/ /go/src/mjpclab.dev/ghfs/.git/
4-
COPY go.mod /go/src/mjpclab.dev/ghfs/go.mod
5-
COPY src/ /go/src/mjpclab.dev/ghfs/src/
6-
COPY build/ /go/src/mjpclab.dev/ghfs/build/
7-
RUN sed -i 's;://[^/ ]*;://mirrors.aliyun.com;' /etc/apk/repositories
8-
RUN apk add bash
9-
RUN ["/bin/bash", "-c", "cd /go/src/mjpclab.dev/ghfs/build/; source ./build.inc.sh; go build -ldflags \"$(getLdFlags)\" -o /tmp/ghfs /go/src/mjpclab.dev/ghfs/main.go"]
10-
RUN mkdir -p /output/usr/local/bin/; cp /tmp/ghfs /output/usr/local/bin/;
2+
COPY . /go/src/mjpclab.dev/ghfs/
3+
RUN \
4+
sed -i 's;://[^/ ]*;://mirrors.aliyun.com;' /etc/apk/repositories; \
5+
apk add bash; \
6+
mkdir -p /output/usr/local/bin/;
7+
RUN ["/bin/bash", "-c", "cd /go/src/mjpclab.dev/ghfs/build/; source ./build.inc.sh; go build -ldflags \"$(getLdFlags)\" -o /output/usr/local/bin/ghfs ../main.go"]
118
COPY conf/docker-image/ /output/
129

1310
FROM alpine
@@ -17,7 +14,7 @@ EXPOSE 8080 8443
1714
USER nobody
1815
CMD [ \
1916
"/usr/local/bin/ghfs", \
20-
"--listen-plain", "8080", "-r", "/var/ghfs/", \
21-
",,", \
22-
"--listen-tls", "8443", "-c", "/etc/server.crt", "-k", "/etc/server.key", "-r", "/var/ghfs/" \
17+
"-r", "/var/ghfs/", \
18+
"--listen-plain", "8080", \
19+
"--listen-tls", "8443", "-c", "/etc/server.crt", "-k", "/etc/server.key" \
2320
]

0 commit comments

Comments
 (0)