File tree Expand file tree Collapse file tree 2 files changed +24
-9
lines changed
Expand file tree Collapse file tree 2 files changed +24
-9
lines changed Original file line number Diff line number Diff line change 4242 push : true
4343 sbom : true
4444 build-args : |
45- GITLAB_SYNC_VERSION=${{ github.ref_name }}
45+ VERSION=${{ github.ref_name }}
46+ REVISION=${{ github.sha }}
47+ BUILD_DATE=${{ github.event.head_commit.timestamp }}
4648 tags : |
4749 ghcr.io/${{ env.REPO_NAME }}:${{ github.ref_name }}
4850 ghcr.io/${{ env.REPO_NAME }}:${{ env.MAJOR }}.${{ env.MINOR }}
Original file line number Diff line number Diff line change 1- FROM docker.io/golang:1.23.7 -alpine AS build
1+ FROM docker.io/golang:1.24.2 -alpine AS build
22
3- ARG GITLAB_SYNC_VERSION ="dev"
3+ ARG VERSION ="dev"
44
55WORKDIR /app
66
77COPY go.mod .
88COPY ./cmd/ ./cmd/
9- COPY ./mirroring/ ./mirroring/
10- COPY ./utils/ ./utils/
9+ COPY ./internal/ ./internal/
10+
11+ ENV GO111MODULE=on \
12+ CGO_ENABLED=0
1113
1214RUN go mod tidy && \
13- go build -ldflags "-X 'main.version=${GITLAB_SYNC_VERSION}'" -o /app/bin/gitlab-sync ./cmd/main.go
15+ go build -ldflags "-X 'main.version=${VERSION}'" -o /app/bin/gitlab-sync ./cmd/main.go
16+
17+ FROM scratch
1418
15- FROM docker.io/alpine:latest
19+ ARG BUILD_DATE="1970-01-01T00:00:00Z" \
20+ VERSION="dev" \
21+ REVISION="dev"
1622
17- RUN adduser -u 1000 -D -S gitlab-sync
23+ LABEL org.opencontainers.image.title="gitlab-sync" \
24+ org.opencontainers.image.description="synchronize GitLab projects and groups between two GitLab instances" \
25+ org.opencontainers.image.source="${SOURCE}" \
26+ org.opencontainers.image.url="gitlab.com/boxboxjason/gitlab-sync" \
27+ org.opencontainers.image.created="${BUILD_DATE}" \
28+ org.opencontainers.image.revision="${REVISION}" \
29+ org.opencontainers.image.version="${VERSION}" \
30+ org.opencontainers.image.vendor="boxboxjason"
1831
19- COPY --from=build --chown=gitlab-sync --chmod=550 /app/bin/gitlab-sync /usr/local/bin/gitlab-sync
32+ COPY --from=build /app/bin/gitlab-sync /usr/local/bin/gitlab-sync
2033
2134ENTRYPOINT [ "/usr/local/bin/gitlab-sync" ]
You can’t perform that action at this time.
0 commit comments