Skip to content

Commit

Permalink
Docker image and release improvements (#242)
Browse files Browse the repository at this point in the history
* Add required packages to official Dockerfile

This commit installs packages in the official Docker image that are required for running some GoVPP CLI.

Signed-off-by: Ondrej Fabry <[email protected]>

* Set user/host for built binaries in release workflow

Signed-off-by: Ondrej Fabry <[email protected]>

* Add make target comment

Signed-off-by: Ondrej Fabry <[email protected]>

---------

Signed-off-by: Ondrej Fabry <[email protected]>
  • Loading branch information
ondrej-fabry authored Sep 20, 2024
1 parent 845b9bc commit 5145075
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 3 deletions.
4 changes: 4 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,10 @@ jobs:
username: ${{github.actor}}
password: ${{secrets.GITHUB_TOKEN}}

- name: "Print environment"
run: |
env | sort
- name: "Release Version"
if: success() && startsWith(github.ref, 'refs/tags/v')
uses: goreleaser/goreleaser-action@v6
Expand Down
7 changes: 5 additions & 2 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ builds:
- -X go.fd.io/govpp/version.commit={{.FullCommit}}
- -X go.fd.io/govpp/version.branch={{.Branch}}
- -X go.fd.io/govpp/version.buildStamp={{.Timestamp}}
- -X go.fd.io/govpp/version.buildUser={{if index .Env "USER"}}{{.Env.USER}}{{else}}goreleaser{{end}}
- -X go.fd.io/govpp/version.buildHost={{if index .Env "HOSTNAME"}}{{.Env.HOSTNAME}}{{else}}goreleaser{{end}}

archives:
- id: govpp-archive
Expand All @@ -53,10 +55,11 @@ changelog:

dockers:
- dockerfile: Dockerfile.govpp
skip_push: auto
image_templates:
- "ghcr.io/fdio/govpp:{{ .Tag }}"
- "ghcr.io/fdio/govpp:v{{ .Major }}.{{ .Minor }}"
- "ghcr.io/fdio/govpp:latest"
- "{{if not .Prerelease}}ghcr.io/fdio/govpp:v{{ .Major }}.{{ .Minor }}{{end}}"
- "{{if not .Prerelease}}ghcr.io/fdio/govpp:latest{{end}}"
build_flag_templates:
- "--pull"
- "--label=org.opencontainers.image.created={{.Date}}"
Expand Down
12 changes: 11 additions & 1 deletion Dockerfile.govpp
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
FROM scratch
FROM alpine:3.20

RUN set -eux; \
apk add --no-cache \
bash \
git \
make \
python3 \
py3-ply

COPY govpp /

ENTRYPOINT ["/govpp"]
9 changes: 9 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,15 @@ install-proxy: ## Install vpp-proxy
@echo "# installing vpp-proxy ${VERSION}"
@go install ${GO_BUILD_ARGS} ./cmd/vpp-proxy

.PHONY: install-goreleaser
install-goreleaser: ## Install goreleaser
@echo "# installing goreleaser"
@go install github.com/goreleaser/goreleaser/v2@latest

.PHONY: release-snapshot
release-snapshot: ## Release snapshot
@goreleaser release --clean --snapshot

.PHONY: generate
generate: generate-binapi ## Generate all

Expand Down

0 comments on commit 5145075

Please sign in to comment.