Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 10 additions & 2 deletions .github/workflows/docker-build-push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,14 @@ jobs:
with:
images: ${{ secrets.DOCKERHUB_USERNAME }}/goduckbot
flavor: |
latest=${{ github.event_name == 'push' }} # Apply latest on all push events (master or tags)
latest=${{ github.event_name == 'push' && (github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/tags/v')) }}
tags: |
type=ref,event=branch
type=ref,event=pr
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
type=semver,pattern={{major}}
type=raw,value={{sha}},enable={{isDefaultBranch}}

- name: Build and push Docker image
uses: docker/build-push-action@v6
Expand All @@ -48,4 +52,8 @@ jobs:
platforms: linux/amd64,linux/arm64
push: ${{ github.event_name == 'push' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
labels: ${{ steps.meta.outputs.labels }}
build-args: |
VERSION=${{ github.ref_name }}
COMMIT_SHA=${{ github.sha }}
BUILD_DATE=${{ github.event.head_commit.timestamp || github.event.pull_request.updated_at || github.event.repository.updated_at }}
22 changes: 21 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,12 +1,32 @@
# Stage 1: Build the Go binary
FROM golang:1.24-bookworm AS builder
FROM golang:1.23-bookworm AS builder

# Build arguments for version metadata
ARG VERSION=dev
ARG COMMIT_SHA=unknown
ARG BUILD_DATE=unknown

WORKDIR /app
COPY . .
RUN go mod download
RUN CGO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo -o goduckbot .

# Stage 2: Create a minimal runtime image
FROM debian:bookworm-slim

# Build arguments for labels (passed from build stage)
ARG VERSION=dev
ARG COMMIT_SHA=unknown
ARG BUILD_DATE=unknown

# Labels for image metadata
LABEL org.opencontainers.image.title="goduckbot" \
org.opencontainers.image.description="duckbot using Go and a local node" \
org.opencontainers.image.version="${VERSION}" \
org.opencontainers.image.revision="${COMMIT_SHA}" \
org.opencontainers.image.created="${BUILD_DATE}" \
org.opencontainers.image.source="https://github.com/wayne/goduckbot"
Comment on lines +22 to +28
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

Fix incorrect org.opencontainers.image.source value.
The source label points to wayne/goduckbot, but the PR target repo appears to be wcatz/goduckbot. This metadata will be user-visible and should match the actual repo.

Suggested fix
-      org.opencontainers.image.source="https://github.com/wayne/goduckbot"
+      org.opencontainers.image.source="https://github.com/wcatz/goduckbot"
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
# Labels for image metadata
LABEL org.opencontainers.image.title="goduckbot" \
org.opencontainers.image.description="duckbot using Go and a local node" \
org.opencontainers.image.version="${VERSION}" \
org.opencontainers.image.revision="${COMMIT_SHA}" \
org.opencontainers.image.created="${BUILD_DATE}" \
org.opencontainers.image.source="https://github.com/wayne/goduckbot"
# Labels for image metadata
LABEL org.opencontainers.image.title="goduckbot" \
org.opencontainers.image.description="duckbot using Go and a local node" \
org.opencontainers.image.version="${VERSION}" \
org.opencontainers.image.revision="${COMMIT_SHA}" \
org.opencontainers.image.created="${BUILD_DATE}" \
org.opencontainers.image.source="https://github.com/wcatz/goduckbot"
🤖 Prompt for AI Agents
In `@Dockerfile` around lines 22 - 28, Update the Dockerfile LABEL for
org.opencontainers.image.source to point to the correct repository; in the LABEL
block (look for the LABEL and the org.opencontainers.image.source entry) replace
the incorrect "https://github.com/wayne/goduckbot" value with the correct
"https://github.com/wcatz/goduckbot" so the image metadata reflects the actual
repo.


WORKDIR /app
COPY --from=builder /app/goduckbot /app/goduckbot
# Add runtime dependencies if needed
Expand Down
4 changes: 2 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
module duckBot

go 1.24.0
go 1.23.0

toolchain go1.24.5
toolchain go1.23.0

require (
github.com/blinklabs-io/adder v0.35.0
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ github.com/blinklabs-io/gouroboros v0.148.0 h1:B8+3oLKk+vSUim3arbl1euf39oCvfwZGg
github.com/blinklabs-io/gouroboros v0.148.0/go.mod h1:UqNKi2y70+0s+0QxSwox+pdB++lq2RqUSWtErngs8NQ=
github.com/blinklabs-io/ouroboros-mock v0.4.0 h1:ppOcTMnC/2f5rYYSlvNqcGfAQOIpMCSDUrNh9K6a4mY=
github.com/blinklabs-io/ouroboros-mock v0.4.0/go.mod h1:e+Kck8bmdOuaN7IfkbVvbqAVlskXNXB95oHI3YlFG5g=
github.com/blinklabs-io/plutigo v0.0.18 h1:axw0QVrdiqEjt+ssKs5zY2ycogZ+j5r0IETHkAda+8Q=
github.com/blinklabs-io/plutigo v0.0.18/go.mod h1:L72ik2SFGruMCxqI5nnuMMz0TwSu9Fk+MekKynr3SPQ=
github.com/blinklabs-io/plutigo v0.0.19 h1:xEcVuMWUpmhMGP4NvXjiWvB9Ca7JVlDdDZloNAVhTG8=
github.com/blinklabs-io/plutigo v0.0.19/go.mod h1:1lnzWoxGFZ/kHM7P8yw+XNKACwRgELLaGtm+PDp8uuw=
github.com/btcsuite/btcd v0.20.1-beta/go.mod h1:wVuoA8VJLEcwgqHBwHmzLRazpKxTv13Px/pDuV7OomQ=
github.com/btcsuite/btcd v0.22.0-beta.0.20220111032746-97732e52810c/go.mod h1:tjmYdS6MLJ5/s0Fj4DbLgSbDHbEqLJrtnHecBFkdz5M=
github.com/btcsuite/btcd v0.23.5-0.20231215221805-96c9fd8078fd/go.mod h1:nm3Bko6zh6bWP60UxwoT5LzdGJsQJaPo6HjduXq9p6A=
Expand Down
Loading