File tree Expand file tree Collapse file tree 2 files changed +39
-11
lines changed
Expand file tree Collapse file tree 2 files changed +39
-11
lines changed Original file line number Diff line number Diff line change 11---
22# Github Actions release for rclone
3- # -*- compile-command: "yamllint -f build_publish_docker_image.yml" -*-
3+ # -*- compile-command: "yamllint -f parsable build_publish_docker_image.yml" -*-
44
55name : Build & Push Docker Images
66
1111 - ' **'
1212 tags :
1313 - ' **'
14- pull_request :
1514 workflow_dispatch :
1615 inputs :
1716 manual :
2120
2221jobs :
2322 build-image :
24- if : inputs.manual || (github.repository == 'rclone/rclone' && ( github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name != github.event.pull_request.base.repo.full_name) )
23+ if : inputs.manual || (github.repository == 'rclone/rclone' && github.event_name != 'pull_request')
2524 timeout-minutes : 60
2625 strategy :
2726 fail-fast : false
@@ -192,6 +191,7 @@ jobs:
192191 if-no-files-found : error
193192
194193 merge-image :
194+ name : Merge & Push Final Docker Image
195195 runs-on : ubuntu-24.04
196196 needs :
197197 - build-image
Original file line number Diff line number Diff line change 11FROM golang:alpine AS builder
22
3- COPY . /go/src/github.com/rclone/rclone/
3+ ARG CGO_ENABLED=0
4+
45WORKDIR /go/src/github.com/rclone/rclone/
56
6- RUN apk add --no-cache make bash gawk git
7- RUN \
8- CGO_ENABLED=0 \
9- make
10- RUN ./rclone version
7+ RUN echo "**** Set Go Environment Variables ****" && \
8+ go env -w GOCACHE=/root/.cache/go-build
9+
10+ RUN echo "**** Install Dependencies ****" && \
11+ apk add --no-cache \
12+ make \
13+ bash \
14+ gawk \
15+ git
16+
17+ COPY go.mod .
18+ COPY go.sum .
19+
20+ RUN echo "**** Download Go Dependencies ****" && \
21+ go mod download -x
22+
23+ RUN echo "**** Verify Go Dependencies ****" && \
24+ go mod verify
25+
26+ COPY . .
27+
28+ RUN --mount=type=cache,target=/root/.cache/go-build,sharing=locked \
29+ echo "**** Build Binary ****" && \
30+ make
31+
32+ RUN echo "**** Print Version Binary ****" && \
33+ ./rclone version
1134
1235# Begin final image
1336FROM alpine:latest
1437
15- RUN apk --no-cache add ca-certificates fuse3 tzdata && \
16- echo "user_allow_other" >> /etc/fuse.conf
38+ RUN echo "**** Install Dependencies ****" && \
39+ apk add --no-cache \
40+ ca-certificates \
41+ fuse3 \
42+ tzdata && \
43+ echo "Enable user_allow_other in fuse" && \
44+ echo "user_allow_other" >> /etc/fuse.conf
1745
1846COPY --from=builder /go/src/github.com/rclone/rclone/rclone /usr/local/bin/
1947
You can’t perform that action at this time.
0 commit comments