Skip to content

Commit 83b7b8e

Browse files
committed
feat: added a docker container to be used as an init container
1 parent e12b256 commit 83b7b8e

File tree

4 files changed

+51
-4
lines changed

4 files changed

+51
-4
lines changed

.github/workflows/docker.yaml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
name: docker
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
tags:
8+
- 'v*'
9+
10+
permissions:
11+
contents: read
12+
packages: write
13+
14+
jobs:
15+
build-and-tag:
16+
runs-on: ubuntu-latest
17+
steps:
18+
- uses: actions/checkout@v3
19+
with:
20+
fetch-depth: 0
21+
- run: git fetch --force --tags
22+
- uses: docker/login-action@v2
23+
with:
24+
registry: ghcr.io
25+
username: ${{ github.actor }}
26+
password: ${{ secrets.GITHUB_TOKEN }}
27+
- uses: docker/setup-qemu-action@v2
28+
- run: docker build -t ghcr.io/robbert229/jaeger-postgresql:${{ github.event_name }} .
29+
- run: docker push ghcr.io/robbert229/jaeger-postgresql:${{ github.event_name }}

.github/workflows/release.yaml

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,11 +32,8 @@ jobs:
3232
- name: Run GoReleaser
3333
uses: goreleaser/goreleaser-action@v5
3434
with:
35-
# either 'goreleaser' (default) or 'goreleaser-pro'
3635
distribution: goreleaser
3736
version: latest
3837
args: release --clean ${{ env.flags }}
3938
env:
40-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
41-
# Your GoReleaser Pro key, if you are using the 'goreleaser-pro' distribution
42-
# GORELEASER_KEY: ${{ secrets.GORELEASER_KEY }}
39+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

Dockerfile

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
FROM golang:1.22.1-bookworm as builder
2+
3+
WORKDIR /app
4+
5+
COPY go.mod go.sum /app/
6+
RUN go mod download
7+
8+
COPY main.go /app/
9+
COPY ./internal /app/internal
10+
RUN CGO_ENABLED=0 go build .
11+
12+
FROM alpine:3.19
13+
14+
WORKDIR /app
15+
COPY --from=builder /app/jaeger-postgresql .
16+
COPY ./hack/run.sh /app/run.sh
17+
18+
CMD ["./run.sh"]

hack/run.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
#!/bin/env bash
2+
3+
cp /app/jaeger-postgresql /mnt/plugin

0 commit comments

Comments
 (0)