-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(#93): add latest mainline docker build
- Loading branch information
1 parent
6f4f838
commit cbfc161
Showing
3 changed files
with
41 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
name: Create and publish Docker image | ||
|
||
on: | ||
push: | ||
branches: | ||
- 'main' | ||
|
||
jobs: | ||
call_build-and-push-image: | ||
permissions: | ||
contents: read | ||
packages: write | ||
uses: eurofurence/reg-workflows/.github/workflows/docker-build-push.yml@main | ||
with: | ||
image-name: ${{ github.repository }} | ||
image-tags: latest | ||
full-repo-url: https://github.com/${{ github.repository }} | ||
branch-or-tag-name: ${{ github.ref_name }} | ||
commit-hash: ${{ github.sha }} | ||
registry-user: ${{ github.actor }} | ||
secrets: | ||
registry-pass: ${{ secrets.GITHUB_TOKEN }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
FROM golang:1 as build | ||
|
||
COPY . /app | ||
WORKDIR /app | ||
|
||
RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -ldflags="-w -s" cmd/main.go | ||
|
||
RUN chmod 755 main | ||
|
||
FROM scratch | ||
|
||
COPY --from=build /app/main /main | ||
COPY --from=build /etc/ssl/certs /etc/ssl/certs | ||
|
||
# run as an unprivileged unnamed user that has no write permissions on the binary | ||
USER 8877 | ||
|
||
ENTRYPOINT ["/main"] |