Skip to content

Build docker image #96

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Feb 23, 2025
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: 1 addition & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ jobs:

- name: Run checks
run: |
sudo apt-get -qq update || true
make ci

- name: Test Vulnerability
Expand Down
28 changes: 19 additions & 9 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,13 @@ jobs:
name: Build
runs-on: ubuntu-24.04
steps:
- name: Check out code into the Go module directory
uses: actions/checkout@v1
- uses: actions/checkout@v1

- name: Set up Go 1.24
uses: actions/setup-go@v5
with:
go-version: '1.24'
id: go

- name: Print version info
id: semver
Expand All @@ -32,21 +37,26 @@ jobs:
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Build
- name: Publish to GitHub Container Registry
env:
REGISTRY: ghcr.io/appscode
DOCKER_TOKEN: ${{ secrets.LGTM_GITHUB_TOKEN }}
USERNAME: 1gtm
APPSCODE_ENV: prod
run: |
make release
docker login ghcr.io --username ${USERNAME} --password ${DOCKER_TOKEN}
make release COMPRESS=yes

- name: Release
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/')
with:
files: |
bin/offline-license-server-linux-amd64
bin/offline-license-server-linux-arm
bin/offline-license-server-linux-arm64
bin/offline-license-server-darwin-amd64
bin/offline-license-server-darwin-arm64
bin/offline-license-server-darwin-amd64.tar.gz
bin/offline-license-server-darwin-arm64.tar.gz
bin/offline-license-server-linux-amd64.tar.gz
bin/offline-license-server-linux-arm64.tar.gz
bin/offline-license-server-windows-amd64.zip
bin/offline-license-server-checksums.txt
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
33 changes: 33 additions & 0 deletions Dockerfile.dbg
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# Copyright AppsCode Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

FROM ghcr.io/appscode/dlv:1.24

FROM {ARG_FROM}

LABEL org.opencontainers.image.source https://github.com/appscode-cloud/offline-license-server

RUN set -x \
&& apt-get update \
&& apt-get upgrade -y \
&& apt-get install -y --no-install-recommends ca-certificates openssh-client \
&& rm -rf /var/lib/apt/lists/* /usr/share/doc /usr/share/man /tmp/* \
&& echo 'Etc/UTC' > /etc/timezone

ADD bin/{ARG_BIN}-{ARG_OS}-{ARG_ARCH} /{ARG_BIN}
COPY --from=0 /usr/local/bin/dlv /bin/dlv

EXPOSE 40000

ENTRYPOINT ["/bin/dlv", "--listen=:40000", "--headless=true", "--api-version=2", "exec", "/{ARG_BIN}", "--"]
27 changes: 27 additions & 0 deletions Dockerfile.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# Copyright AppsCode Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

FROM {ARG_FROM}

LABEL org.opencontainers.image.source https://github.com/appscode-cloud/offline-license-server

RUN set -x \
&& apk add --update --upgrade --no-cache pcre2 ca-certificates tzdata openssh-client \
&& echo 'Etc/UTC' > /etc/timezone

ADD bin/{ARG_BIN}-{ARG_OS}-{ARG_ARCH} /{ARG_BIN}

USER 65534

ENTRYPOINT ["/{ARG_BIN}"]
Loading
Loading