Skip to content

Commit 329b1f1

Browse files
Docker Image Support (#63)
1 parent 38d0c9e commit 329b1f1

File tree

4 files changed

+124
-6
lines changed

4 files changed

+124
-6
lines changed

.github/workflows/goreleaser.yaml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,15 @@ jobs:
2121
-
2222
name: Set up Go
2323
uses: actions/setup-go@v5
24+
-
25+
name: Login to Docker Hub
26+
uses: docker/login-action@v3
27+
with:
28+
username: ${{ secrets.DOCKER_USERNAME }}
29+
password: ${{ secrets.DOCKER_ACCESS_TOKEN }}
30+
-
31+
name: Set up QEMU
32+
uses: docker/setup-qemu-action@v3
2433
-
2534
name: Run GoReleaser
2635
uses: goreleaser/goreleaser-action@v6

.goreleaser.yaml

Lines changed: 87 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,14 @@ builds:
1414
# Default: Project directory name
1515
binary: pingcli
1616

17-
# Custom ldflags.
17+
# Custom environment variables to be set during the builds.
18+
# Invalid environment variables will be ignored.
19+
# For more info refer to: https://pkg.go.dev/cmd/go#hdr-Environment_variables
1820
#
19-
# Default: '-s -w -X main.version={{.Version}} -X main.commit={{.Commit}} -X main.date={{.Date}} -X main.builtBy=goreleaser'.
21+
# Default: os.Environ() ++ env config section.
2022
# Templates: allowed.
21-
ldflags:
22-
- '-s -w -X main.version={{.Version}} -X main.commit={{.Commit}}'
23+
env:
24+
- CGO_ENABLED=0
2325

2426
# GOOS list to build for.
2527
# For more info refer to: https://golang.org/doc/install/source#environment
@@ -96,8 +98,7 @@ checksum:
9698
disable: false
9799

98100
brews:
99-
-
100-
# Git author used to commit to the repository.
101+
- # Git author used to commit to the repository.
101102
commit_author:
102103
name: goreleaserbot
103104
@@ -158,3 +159,83 @@ brews:
158159
name: homebrew-tap
159160

160161
token: "{{ .Env.GORELEASER_HOMEBREW_TAP_GITHUB_PAT}}"
162+
163+
dockers:
164+
# You can have multiple Docker images.
165+
# Templates of the Docker image names.
166+
#
167+
# Templates: allowed.
168+
- image_templates:
169+
- "pingidentity/pingcli:{{ .Tag }}-amd64"
170+
171+
# Docker build flags.
172+
#
173+
# Templates: allowed.
174+
build_flag_templates:
175+
- "--platform=linux/amd64"
176+
- "--pull"
177+
178+
# GOARCH of the built binaries/packages that should be used.
179+
# Default: 'amd64'.
180+
goarch: amd64
181+
182+
# Set the "backend" for the Docker pipe.
183+
#
184+
# Valid options are: docker, buildx, podman.
185+
#
186+
# Podman is a GoReleaser Pro feature and is only available on Linux.
187+
#
188+
# Default: 'docker'.
189+
use: buildx
190+
191+
# You can have multiple Docker images.
192+
# Templates of the Docker image names.
193+
#
194+
# Templates: allowed.
195+
- image_templates:
196+
- "pingidentity/pingcli:{{ .Tag }}-arm64"
197+
198+
# Docker build flags.
199+
#
200+
# Templates: allowed.
201+
build_flag_templates:
202+
- "--platform=linux/arm64"
203+
- "--pull"
204+
205+
# GOARCH of the built binaries/packages that should be used.
206+
# Default: 'amd64'.
207+
goarch: arm64
208+
209+
# Set the "backend" for the Docker pipe.
210+
#
211+
# Valid options are: docker, buildx, podman.
212+
#
213+
# Podman is a GoReleaser Pro feature and is only available on Linux.
214+
#
215+
# Default: 'docker'.
216+
use: buildx
217+
218+
docker_manifests:
219+
# Name for the manifest.
220+
#
221+
# Templates: allowed.
222+
- name_template: "pingidentity/pingcli:latest"
223+
224+
# Image name to be added to this manifest.
225+
#
226+
# Templates: allowed.
227+
image_templates:
228+
- "pingidentity/pingcli:{{ .Tag }}-amd64"
229+
- "pingidentity/pingcli:{{ .Tag }}-arm64"
230+
231+
# Name for the manifest.
232+
#
233+
# Templates: allowed.
234+
- name_template: "pingidentity/pingcli:{{ .Tag }}"
235+
236+
# Image name to be added to this manifest.
237+
#
238+
# Templates: allowed.
239+
image_templates:
240+
- "pingidentity/pingcli:{{ .Tag }}-amd64"
241+
- "pingidentity/pingcli:{{ .Tag }}-arm64"

Dockerfile

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# Use Alpine as the runtime image
2+
FROM alpine:latest
3+
4+
# Copy in repo
5+
COPY pingcli /usr/local/bin/
6+
7+
# Set permissions for the binary
8+
RUN chmod +x /usr/local/bin/pingcli
9+
10+
# Set the entry point
11+
ENTRYPOINT ["pingcli"]
12+
13+
# Allow subcommands
14+
CMD []

README.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,20 @@ The Ping CLI is a unified command line interface for configuring and managing Pi
44

55
## Install
66

7+
#### Docker
8+
9+
Use the [Ping CLI Docker image](https://hub.docker.com/r/pingidentity/pingcli)
10+
11+
```text
12+
Pull Image:
13+
docker pull pingidentity/pingcli:latest
14+
15+
Example Commands:
16+
docker run <Image ID> <sub commands>
17+
18+
docker run <Image ID> --version
19+
```
20+
721
#### macOS/Linux - Homebrew
822

923
Use PingIdentity's Homebrew tap to install Ping CLI

0 commit comments

Comments
 (0)