-
-
Notifications
You must be signed in to change notification settings - Fork 611
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2 from mcpherrinm/mattm-ct-test-srv-container
Add dockerfile and GHA to build and publish ct-test-srv container
- Loading branch information
Showing
3 changed files
with
87 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
# Build containers on every PR | ||
# See also container-release.yml | ||
|
||
name: Container Build | ||
|
||
on: | ||
push: | ||
branches: [main] | ||
pull_request: | ||
branches: [main] | ||
workflow_dispatch: | ||
|
||
jobs: | ||
build-container: | ||
runs-on: ubuntu-24.04 | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
include: | ||
- dockerfile: test/ct-test-srv/Dockerfile | ||
image: ghcr.io/mcpherrinm/ct-test-srv | ||
permissions: | ||
contents: read | ||
packages: write | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
persist-credentials: false | ||
|
||
- name: Build | ||
run: docker buildx . -f "${{ matrix.image }}" -t "${{ image }}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
# Build and publish containers for this release | ||
# see also container-build.yml | ||
|
||
name: Container Release | ||
|
||
on: | ||
push: | ||
tags: | ||
- release-* | ||
|
||
jobs: | ||
push-container: | ||
runs-on: ubuntu-24.04 | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
include: | ||
- dockerfile: TBD | ||
image: ghcr.io/mcpherrinm/boulder | ||
- dockerfile: test/ct-test-srv/Dockerfile | ||
image: ghcr.io/mcpherrinm/ct-test-srv | ||
permissions: | ||
contents: read | ||
packages: write | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
persist-credentials: false | ||
|
||
- name: Build | ||
run: docker buildx . -f "${{ matrix.image }}" -t "${{ image }}" | ||
|
||
- name: login | ||
run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u "${{ github.actor }}" --password-stdin | ||
|
||
- name: Push | ||
run: docker push "${{ image }}:${{ github.ref_name }}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
FROM golang:1.23.4 AS build | ||
|
||
WORKDIR /app | ||
|
||
COPY go.mod go.sum vendor ./ | ||
|
||
COPY . . | ||
|
||
RUN go build -o /bin/ct-test-srv ./test/ct-test-srv/main.go | ||
|
||
FROM ubuntu:24.04 | ||
|
||
COPY --from=build /bin/ct-test-srv /bin/ct-test-srv | ||
|
||
COPY test/ct-test-srv/ct-test-srv.json /etc/ct-test-srv.json | ||
|
||
ENTRYPOINT ["/bin/ct-test-srv"] | ||
|
||
CMD ["-config", "/etc/ct-test-srv.json"] |