Skip to content

Commit

Permalink
Feat: Add debug build process and Dockerfile
Browse files Browse the repository at this point in the history
Introduced a new Dockerfile.debug to support building a debug version of the application. Updated the GitHub Actions workflow to include steps for building and pushing the debug image to the container registry. This enables enhanced debugging and testing capabilities for the application.

Signed-off-by: Christian Roessner <c@roessner.co>
  • Loading branch information
Christian Roessner committed Sep 26, 2024
1 parent 01533c3 commit 93c91e7
Show file tree
Hide file tree
Showing 2 changed files with 47 additions and 0 deletions.
10 changes: 10 additions & 0 deletions .github/workflows/docker-features.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,3 +34,13 @@ jobs:
tags: |
ghcr.io/${{ github.repository_owner }}/nauthilus:dev
outputs: type=image,name=target,annotation-index.org.opencontainers.image.description=Multi purpose authentication server

- uses: docker/build-push-action@v5
with:
context: .
file: ./Dockerfile.debug
platforms: linux/amd64,linux/arm64
push: true
tags: |
ghcr.io/${{ github.repository_owner }}/nauthilus:dev-dbg
outputs: type=image,name=target,annotation-index.org.opencontainers.image.description=Multi purpose authentication server
37 changes: 37 additions & 0 deletions Dockerfile.debug
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
FROM --platform=$BUILDPLATFORM golang:1.23-alpine3.20 AS builder

LABEL org.opencontainers.image.authors="christian@roessner.email"
LABEL org.opencontainers.image.source="https://github.com/croessner/nauthilus"
LABEL org.opencontainers.image.description="Multi purpose authentication server"
LABEL org.opencontainers.image.licenses=GPL3
LABEL com.roessner-network-solutions.vendor="Rößner-Network-Solutions"

WORKDIR /build

COPY . ./

# Set necessarry environment vairables and compile the app
ENV CGO_ENABLED=0
RUN apk add --no-cache build-base git

RUN cd server && go build -mod=vendor -tags="register2fa" -ldflags="-s -X main.version=dev-dbg" -o nauthilus .
RUN cd docker-healthcheck && go build -mod=vendor -ldflags="-s" -o healthcheck .
RUN cd contrib/smtp-server && go build -mod=vendor -ldflags="-s" -o fakesmtp .
RUN cd contrib/imap-server && go build -mod=vendor -ldflags="-s" -o fakeimap .

RUN addgroup -S nauthilus; \
adduser -S nauthilus -G nauthilus -D -H -s /bin/nologin

RUN apk --no-cache --upgrade add ca-certificates bash curl

# set up nsswitch.conf for Go's "netgo" implementation
# - https://github.com/golang/go/blob/go1.9.1/src/net/conf.go#L194-L275
RUN echo 'hosts: files dns' > /etc/nsswitch.conf

ENV TERM=xterm-256color

EXPOSE 8180

USER nauthilus

CMD ["/build/server/nauthilus"]

0 comments on commit 93c91e7

Please sign in to comment.