forked from TrueCloudLab/rclone
Add Docker workflow support #3460
* Use a multi-stage build to reduce final image size. * Run 'quicktest' make target before building. * Built binary won't run on Alpine unless statically linked.
This commit is contained in:
parent
01fa6835c7
commit
52efb7e6d0
1 changed files with 21 additions and 0 deletions
21
Dockerfile
Normal file
21
Dockerfile
Normal file
|
@ -0,0 +1,21 @@
|
||||||
|
FROM golang AS builder
|
||||||
|
|
||||||
|
COPY . /go/src/github.com/rclone/rclone/
|
||||||
|
WORKDIR /go/src/github.com/rclone/rclone/
|
||||||
|
|
||||||
|
RUN make quicktest
|
||||||
|
RUN \
|
||||||
|
CGO_ENABLED=0 GOOS=linux GOARCH=amd64 \
|
||||||
|
make
|
||||||
|
RUN ./rclone version
|
||||||
|
|
||||||
|
# Begin final image
|
||||||
|
FROM alpine:latest
|
||||||
|
|
||||||
|
RUN apk --no-cache add ca-certificates
|
||||||
|
|
||||||
|
WORKDIR /root/
|
||||||
|
|
||||||
|
COPY --from=builder /go/src/github.com/rclone/rclone/rclone .
|
||||||
|
|
||||||
|
ENTRYPOINT [ "./rclone" ]
|
Loading…
Add table
Reference in a new issue