Skip to content

Commit

Permalink
ci(docker): docker builds now image and does not dep from goreleaser
Browse files Browse the repository at this point in the history
  • Loading branch information
zeljkobekcic committed Aug 23, 2023
1 parent e6ff515 commit 0fea00e
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 17 deletions.
6 changes: 6 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
.idea
dist
static
wiki
.cobra.yaml
signOSX.sh
6 changes: 1 addition & 5 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ on:
tags:
- "*"
jobs:

goreleaser:
runs-on: macos-13
steps:
Expand Down Expand Up @@ -59,8 +60,6 @@ jobs:

dockerrelease:
runs-on: ubuntu-latest
needs:
- goreleaser
steps:
- name: Checkout
uses: actions/checkout@v2
Expand All @@ -84,9 +83,6 @@ jobs:
uses: docker/build-push-action@v3
with:
push: true
build-args: |
VERSION=${{ env.RELEASE_VERSION }}
GITHUB_REPOSITORY=${{ github.repository }}
tags: |
ghcr.io/iits-consulting/otc-auth:latest
ghcr.io/iits-consulting/otc-auth:${{ env.RELEASE_VERSION }}
Expand Down
19 changes: 7 additions & 12 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,12 +1,7 @@
FROM alpine:3.16
ARG VERSION
ARG GITHUB_REPOSITORY
WORKDIR /opt
USER root
ENV DOWNLOAD_LINK="https://github.com/${GITHUB_REPOSITORY}/releases/download/${VERSION}/otc-auth_${VERSION}_linux_amd64.tar.gz"
RUN apk update && \
apk add --no-cache "curl" && \
rm -rf /var/cache/apk/*echo $DOWNLOAD_LINK && \
curl -LO $DOWNLOAD_LINK && \
tar -zxvf otc-auth* && \
mv otc-auth * /usr/local/bin/
FROM golang:1.20-alpine as builder
WORKDIR /otc-auth
COPY . .
RUN CGO_ENABLED=0 go build .

FROM alpine:3.18
COPY --from=builder /otc-auth/otc-auth /usr/local/bin/otc-auth

0 comments on commit 0fea00e

Please sign in to comment.