-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
91 additions
and
6 deletions.
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,27 @@ | ||
# .circleci/config.yml | ||
version: 2.1 | ||
workflows: | ||
main: | ||
jobs: | ||
- release: | ||
# Only run this job on git tag pushes | ||
filters: | ||
branches: | ||
ignore: /.*/ | ||
tags: | ||
only: /v[0-9]+(\.[0-9]+)*(-.*)*/ | ||
jobs: | ||
release: | ||
docker: | ||
- image: circleci/golang:1.16 | ||
steps: | ||
- checkout | ||
- setup_remote_docker: | ||
version: 19.03.13 | ||
- run: echo "$DOCKER_TOKEN" | docker login --username $DOCKER_USERNAME --password-stdin | ||
# Generate binaries for Github | ||
- run: curl -sL https://git.io/goreleaser | bash | ||
# Generate Docker Image | ||
- run: docker build -t charlysan/gidm:$CIRCLE_TAG . | ||
- run: docker tag charlysan/gidm:$CIRCLE_TAG charlysan/gidm:latest | ||
- run: docker push charlysan/gidm |
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,5 @@ | ||
dockers: | ||
- goarch: arm64 | ||
- goos: linux | ||
- image_templates: | ||
- charlysan/gidm |
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,19 @@ | ||
ARG GO_VERSION=1.15 | ||
ARG ALPINE_VERSION=3.13.0 | ||
|
||
FROM golang:${GO_VERSION}-alpine AS builder | ||
|
||
RUN mkdir -p /app | ||
ADD . /app | ||
WORKDIR /app | ||
|
||
RUN CGO_ENABLED=1 GOOS=linux GOARCH=amd64 go build -ldflags="-s -w" -o /gidm main.go | ||
|
||
# Create alpine runtime image | ||
FROM alpine:${ALPINE_VERSION} as app | ||
|
||
COPY --from=builder /gidm /gidm | ||
|
||
USER 1000 | ||
|
||
ENTRYPOINT ["/gidm"] |
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