Skip to content

Commit

Permalink
add docker edge workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
IrineSistiana committed Oct 19, 2022
1 parent 6995d4e commit 9e3ef83
Show file tree
Hide file tree
Showing 2 changed files with 48 additions and 0 deletions.
32 changes: 32 additions & 0 deletions .github/workflows/build_docker_edge.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: Build and push simple-tls docker edge

on:
push:

jobs:
release-docker:
runs-on: ubuntu-latest
steps:
- name: Set up QEMU
uses: docker/setup-qemu-action@v2

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2

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

- name: Build and push
uses: docker/build-push-action@v3
with:
build-args: |
TAG=${{github.ref_name}}
REPOSITORY=IrineSistiana/simple-tls
platforms: linux/amd64,linux/arm64
file: ./Dockerfile_buildx_edge
push: true
tags: |
${{ secrets.DOCKERHUB_USERNAME }}/simple-tls:edge
16 changes: 16 additions & 0 deletions Dockerfile_buildx_edge
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
FROM --platform=${TARGETPLATFORM} golang:latest as builder
ARG REPOSITORY=IrineSistiana/simple-tls
ARG CGO_ENABLED=0

WORKDIR /root
RUN git clone https://github.com/${REPOSITORY} simple-tls \
&& cd ./simple-tls \
&& git fetch --all --tags \
&& go build -ldflags "-s -w -X main.version=$(git describe --tags --long --always)" -trimpath -o simple-tls

FROM --platform=${TARGETPLATFORM} alpine:latest
LABEL maintainer="IrineSistiana <github.com/IrineSistiana>"

COPY --from=builder /root/simple-tls/simple-tls /usr/bin/

RUN apk add --no-cache ca-certificates

0 comments on commit 9e3ef83

Please sign in to comment.