Skip to content
Merged
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
6 changes: 6 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -110,3 +110,9 @@ jobs:
- name: push container image
# note: forcing use of docker here, since we did docker login above
run: make CONTAINER_CMD=docker image-push
- name: build dev container image
# note: forcing use of docker here, since we did docker login above
run: make CONTAINER_CMD=docker BASE_IMG_TAG=devbuilds-centos-amd64 image-build
- name: push dev container image
# note: forcing use of docker here, since we did docker login above
run: make CONTAINER_CMD=docker BASE_IMG_TAG=devbuilds-centos-amd64 image-push
9 changes: 6 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
# Build smbmetrics
FROM docker.io/golang:1.24 as builder
# Args
ARG BASE_IMG="quay.io/samba.org/samba-server:latest"
ARG GIT_VERSION="(unset)"
ARG COMMIT_ID="(unset)"
ARG ARCH=""

# Build smbmetrics
FROM docker.io/golang:1.24 as builder

WORKDIR /workspace
# Copy the Go Modules manifests
COPY go.mod go.mod
Expand All @@ -23,7 +26,7 @@ RUN CGO_ENABLED=0 GOOS=linux GOARCH=${ARCH} GO111MODULE=on \
-o smbmetrics cmd/main.go

# Use samba-server (with its smb.conf and samba utils) as base image
FROM quay.io/samba.org/samba-server
FROM $BASE_IMG
COPY --from=builder /workspace/smbmetrics /bin/smbmetrics

ENTRYPOINT ["/bin/smbmetrics"]
Expand Down
9 changes: 7 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,12 @@ BUILDAH_CMD:=buildah
YAMLLINT_CMD:=yamllint

# Image URL to use all building/pushing image targets
TAG?=latest
IMG?=quay.io/samba.org/samba-metrics:$(TAG)
BASE_IMG_TAG?=latest
BASE_IMG_URL?=quay.io/samba.org/samba-server
BASE_IMG?=$(BASE_IMG_URL):$(BASE_IMG_TAG)
IMG_TAG?=$(BASE_IMG_TAG)
IMG_URL?=quay.io/samba.org/samba-metrics
IMG?=$(IMG_URL):$(IMG_TAG)

# Get the currently used golang install path (in GOPATH/bin, unless GOBIN is set)
ifeq (,$(shell $(GO_CMD) env GOBIN))
Expand Down Expand Up @@ -94,6 +98,7 @@ image-build: Dockerfile
--build-arg=GIT_VERSION="$(GIT_VERSION)" \
--build-arg=COMMIT_ID="$(COMMIT_ID)" \
--build-arg=ARCH="$(GOARCH)" \
--build-arg=BASE_IMG="$(BASE_IMG)" \
$(CONTAINER_BUILD_OPTS) -f $< -t $(IMG) .

# Push the container image
Expand Down
Loading