Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .dockerignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
vendor
build/*
logs/*
data/*
release/*
Expand Down
17 changes: 16 additions & 1 deletion .github/workflows/build-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,11 @@ on:
required: true
default: 'latest'
type: string
version:
description: 'Version'
required: true
default: 'master'
type: string


# Defines two custom environment variables for the workflow. These are used for the Container registry domain, and a name for the Docker image that this workflow builds.
Expand All @@ -27,10 +32,18 @@ jobs:
packages: write
attestations: write
id-token: write
#
steps:
- name: Checkout repository
uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: 'stable' # The Go version to download (if necessary) and use.
- name: Make Build
id: make_build
env:
VERSION: ${{ inputs.version }}
run: |
make linux-amd64 linux-arm64 -s && ls build
# Uses the `docker/login-action` action to log in to the Container registry registry using the account and password that will publish the packages. Once published, the packages are scoped to the account defined here.
- name: Log in to the Container registry
uses: docker/login-action@v3
Expand Down Expand Up @@ -58,6 +71,8 @@ jobs:
with:
platforms: linux/amd64,linux/arm64
context: .
build-args: VERSION=${{ inputs.version }}
push: true
file: Dockerfile.action
tags: ${{ steps.meta.outputs.tags }}

35 changes: 35 additions & 0 deletions Dockerfile.action
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
FROM debian:bullseye-slim AS stage-build
ARG TARGETARCH
ARG VERSION
ENV VERSION=$VERSION
WORKDIR /opt/wisp

ENV WISP_BUILD_NAME=wisp-${VERSION}-linux-${TARGETARCH}

COPY ./build/${WISP_BUILD_NAME}.tar.gz .
RUN tar -xzvf ${WISP_BUILD_NAME}.tar.gz && mv ${WISP_BUILD_NAME}/wisp /usr/local/bin/wisp

FROM debian:bullseye-slim

ARG TARGETARCH
ENV LANG=en_US.UTF-8
ARG APT_MIRROR=http://deb.debian.org
ARG DEPENDENCIES=" \
bash-completion \
jq \
less \
ca-certificates"

RUN set -ex \
&& sed -i "s@http://.*.debian.org@${APT_MIRROR}@g" /etc/apt/sources.list \
&& ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime \
&& apt-get update \
&& apt-get install -y --no-install-recommends ${DEPENDENCIES} \
&& apt-get clean all \
&& rm -rf /var/lib/apt/lists/*

WORKDIR /opt/wisp

COPY --from=stage-build /usr/local/bin/wisp .

CMD ["./wisp"]