Skip to content

Commit

Permalink
secure-tunnel-server: publish Secure Tunneling compatible server image (
Browse files Browse the repository at this point in the history
  • Loading branch information
at-wat authored May 19, 2021
1 parent 19f9515 commit e491b2c
Show file tree
Hide file tree
Showing 3 changed files with 43 additions and 5 deletions.
37 changes: 37 additions & 0 deletions .github/workflows/tunnel-server.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: tunnel-server
on:
pull_request:
branches:
- master
push:
branches:
- master
tags:
- '*'

jobs:
tunnel-server:
runs-on: ubuntu-latest
steps:
- name: Set image tag
if: startsWith(github.ref, 'refs/tags')
run: echo "IMAGE_TAG=${GITHUB_REF#refs/tags}" | tee -a ${GITHUB_ENV}

- name: Checkout
uses: actions/checkout@v2
- name: Docker build
run: |
docker build \
-t ghcr.io/${{ github.repository_owner }}/aws-iot-secure-tunnel-server:${IMAGE_TAG:-devel} \
-f ./tunnel/cmd/secure-tunnel-server/Dockerfile .
- name: Login to GitHub Container Registry
if: startsWith(github.ref, 'refs/tags')
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.CONTAINER_REGISTRY_TOKEN }}
- name: Push to GitHub Container Registry
if: startsWith(github.ref, 'refs/tags')
run: docker push ghcr.io/${{ github.repository_owner }}/aws-iot-secure-tunnel-server:${IMAGE_TAG:-devel}
2 changes: 2 additions & 0 deletions tunnel/cmd/secure-tunnel-server/.dockerignore
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
secure-tunnel-server
tlsoffloading
docker-compose.yml
9 changes: 4 additions & 5 deletions tunnel/cmd/secure-tunnel-server/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,19 +1,18 @@
# =====================
FROM golang:1.16-alpine3.12 as go-builder
FROM golang:1.16-alpine as go-builder

ENV CGO_ENABLED=0

COPY go.mod /go/src/github.com/seqsense/aws-iot-device-sdk-go/go.mod
COPY go.sum /go/src/github.com/seqsense/aws-iot-device-sdk-go/go.sum
COPY go.mod go.sum /go/src/github.com/seqsense/aws-iot-device-sdk-go/
RUN cd /go/src/github.com/seqsense/aws-iot-device-sdk-go/ && go mod download

COPY . /go/src/github.com/seqsense/aws-iot-device-sdk-go
WORKDIR /go/src/github.com/seqsense/aws-iot-device-sdk-go/tunnel/cmd/secure-tunnel-server
RUN go build -tags netgo -installsuffix netgo
RUN go build -tags netgo -installsuffix netgo -ldflags "-extldflags -static"
RUN cp secure-tunnel-server /usr/local/bin/

# =====================
FROM alpine:3.13
FROM scratch

COPY --from=go-builder /usr/local/bin/secure-tunnel-server /usr/local/bin/

Expand Down

0 comments on commit e491b2c

Please sign in to comment.