Skip to content

Commit f883063

Browse files
committed
Build docker image
Signed-off-by: Tamal Saha <[email protected]>
1 parent 51c0ab3 commit f883063

File tree

5 files changed

+233
-48
lines changed

5 files changed

+233
-48
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ jobs:
2929

3030
- name: Run checks
3131
run: |
32+
sudo apt-get -qq update || true
3233
make ci
3334
3435
- name: Test Vulnerability

.github/workflows/release.yml

Lines changed: 19 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,13 @@ jobs:
1515
name: Build
1616
runs-on: ubuntu-24.04
1717
steps:
18-
- name: Check out code into the Go module directory
19-
uses: actions/checkout@v1
18+
- uses: actions/checkout@v1
19+
20+
- name: Set up Go 1.24
21+
uses: actions/setup-go@v5
22+
with:
23+
go-version: '1.24'
24+
id: go
2025

2126
- name: Print version info
2227
id: semver
@@ -32,21 +37,26 @@ jobs:
3237
- name: Set up Docker Buildx
3338
uses: docker/setup-buildx-action@v3
3439

35-
- name: Build
40+
- name: Publish to GitHub Container Registry
3641
env:
42+
REGISTRY: ghcr.io/appscode
43+
DOCKER_TOKEN: ${{ secrets.LGTM_GITHUB_TOKEN }}
44+
USERNAME: 1gtm
3745
APPSCODE_ENV: prod
3846
run: |
39-
make release
47+
docker login ghcr.io --username ${USERNAME} --password ${DOCKER_TOKEN}
48+
make release COMPRESS=yes
4049
4150
- name: Release
4251
uses: softprops/action-gh-release@v1
4352
if: startsWith(github.ref, 'refs/tags/')
4453
with:
4554
files: |
46-
bin/offline-license-server-linux-amd64
47-
bin/offline-license-server-linux-arm
48-
bin/offline-license-server-linux-arm64
49-
bin/offline-license-server-darwin-amd64
50-
bin/offline-license-server-darwin-arm64
55+
bin/offline-license-server-darwin-amd64.tar.gz
56+
bin/offline-license-server-darwin-arm64.tar.gz
57+
bin/offline-license-server-linux-amd64.tar.gz
58+
bin/offline-license-server-linux-arm64.tar.gz
59+
bin/offline-license-server-windows-amd64.zip
60+
bin/offline-license-server-checksums.txt
5161
env:
5262
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

Dockerfile.dbg

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
# Copyright AppsCode Inc.
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
15+
FROM ghcr.io/appscode/dlv:1.24
16+
17+
FROM {ARG_FROM}
18+
19+
LABEL org.opencontainers.image.source https://github.com/appscode-cloud/offline-license-server
20+
21+
RUN set -x \
22+
&& apt-get update \
23+
&& apt-get upgrade -y \
24+
&& apt-get install -y --no-install-recommends ca-certificates openssh-client \
25+
&& rm -rf /var/lib/apt/lists/* /usr/share/doc /usr/share/man /tmp/* \
26+
&& echo 'Etc/UTC' > /etc/timezone
27+
28+
ADD bin/{ARG_BIN}-{ARG_OS}-{ARG_ARCH} /{ARG_BIN}
29+
COPY --from=0 /usr/local/bin/dlv /bin/dlv
30+
31+
EXPOSE 40000
32+
33+
ENTRYPOINT ["/bin/dlv", "--listen=:40000", "--headless=true", "--api-version=2", "exec", "/{ARG_BIN}", "--"]

Dockerfile.in

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# Copyright AppsCode Inc.
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
15+
FROM {ARG_FROM}
16+
17+
LABEL org.opencontainers.image.source https://github.com/appscode-cloud/offline-license-server
18+
19+
RUN set -x \
20+
&& apk add --update --upgrade --no-cache pcre2 ca-certificates tzdata openssh-client \
21+
&& echo 'Etc/UTC' > /etc/timezone
22+
23+
ADD bin/{ARG_BIN}-{ARG_OS}-{ARG_ARCH} /{ARG_BIN}
24+
25+
USER 65534
26+
27+
ENTRYPOINT ["/{ARG_BIN}"]

0 commit comments

Comments
 (0)