Skip to content

Commit

Permalink
chore(docker): add docker image (#1)
Browse files Browse the repository at this point in the history
  • Loading branch information
BlackHole1 committed Mar 23, 2023
1 parent 5c6e1d7 commit 639b08f
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 0 deletions.
26 changes: 26 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -46,3 +46,29 @@ jobs:
fail_on_unmatched_files: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

docker:
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@24cb9080177205b6e8c946b17badbe402adc938f # v3.4.0

- name: Set up QEMU
uses: docker/setup-qemu-action@e81a89b1732b9c48d79cd809d8d81d79c4647a18 # v2.1.0

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@4b4e9c3e2d4531116a6f8ba8e71fc6e2cb6e6c8c # v2.5.0

- name: Login to DockerHub
uses: docker/login-action@f4ef78c080cd8ba55a85445d5b36e214a81df20a # v2.1.0
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Build and push
uses: docker/build-push-action@3b5e8027fcad23fda98b2e3ac259d8d67585f671 # 4.0.0
with:
context: .
push: true
tags: blackhole007/sesmate:latest,blackhole007/sesmate:${{ github.ref_name }}
15 changes: 15 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
FROM golang:1.20.2 AS builder

WORKDIR /app

COPY . .

RUN GOOS=linux GOARCH=amd64 CGO_ENABLED=0 go build -o sesmate ./cmd/sesmate/

FROM alpine

COPY --from=builder /app/sesmate /usr/local/bin/sesmate

RUN apk update && apk add --no-cache ca-certificates && update-ca-certificates

CMD ["sesmate"]

0 comments on commit 639b08f

Please sign in to comment.