Skip to content

Commit

Permalink
docker: fix build commit and add help target
Browse files Browse the repository at this point in the history
  • Loading branch information
mcnewton committed May 29, 2024
1 parent 36c5be1 commit ad23bc0
Show file tree
Hide file tree
Showing 14 changed files with 82 additions and 15 deletions.
5 changes: 4 additions & 1 deletion scripts/docker/dists/centos7/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,10 @@ COPY . .
RUN git clean -fdxx \
&& git reset --hard HEAD

RUN [ -z "$release" ] || git checkout ${release}
ARG release
RUN [ -z "$release" ] || git checkout ${release} ; \
git status ; \
git log -1 --oneline

#
# Other requirements
Expand Down
5 changes: 4 additions & 1 deletion scripts/docker/dists/debian10/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,10 @@ COPY . .
RUN git clean -fdxx \
&& git reset --hard HEAD

RUN [ -z "$release" ] || git checkout ${release}
ARG release
RUN [ -z "$release" ] || git checkout ${release} ; \
git status ; \
git log -1 --oneline

#
# Install build dependencies
Expand Down
5 changes: 4 additions & 1 deletion scripts/docker/dists/debian11/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,10 @@ COPY . .
RUN git clean -fdxx \
&& git reset --hard HEAD

RUN [ -z "$release" ] || git checkout ${release}
ARG release
RUN [ -z "$release" ] || git checkout ${release} ; \
git status ; \
git log -1 --oneline

#
# Install build dependencies
Expand Down
5 changes: 4 additions & 1 deletion scripts/docker/dists/debian12/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,10 @@ COPY . .
RUN git clean -fdxx \
&& git reset --hard HEAD

RUN [ -z "$release" ] || git checkout ${release}
ARG release
RUN [ -z "$release" ] || git checkout ${release} ; \
git status ; \
git log -1 --oneline

#
# Install build dependencies
Expand Down
5 changes: 4 additions & 1 deletion scripts/docker/dists/debiansid/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,10 @@ COPY . .
RUN git clean -fdxx \
&& git reset --hard HEAD

RUN [ -z "$release" ] || git checkout ${release}
ARG release
RUN [ -z "$release" ] || git checkout ${release} ; \
git status ; \
git log -1 --oneline

#
# Install build dependencies
Expand Down
5 changes: 4 additions & 1 deletion scripts/docker/dists/rocky8/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,10 @@ COPY . .
RUN git clean -fdxx \
&& git reset --hard HEAD

RUN [ -z "$release" ] || git checkout ${release}
ARG release
RUN [ -z "$release" ] || git checkout ${release} ; \
git status ; \
git log -1 --oneline

#
# Other requirements
Expand Down
5 changes: 4 additions & 1 deletion scripts/docker/dists/rocky9/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,10 @@ COPY . .
RUN git clean -fdxx \
&& git reset --hard HEAD

RUN [ -z "$release" ] || git checkout ${release}
ARG release
RUN [ -z "$release" ] || git checkout ${release} ; \
git status ; \
git log -1 --oneline

#
# Other requirements
Expand Down
5 changes: 4 additions & 1 deletion scripts/docker/dists/ubuntu18/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,10 @@ COPY . .
RUN git clean -fdxx \
&& git reset --hard HEAD

RUN [ -z "$release" ] || git checkout ${release}
ARG release
RUN [ -z "$release" ] || git checkout ${release} ; \
git status ; \
git log -1 --oneline

#
# Install build dependencies
Expand Down
5 changes: 4 additions & 1 deletion scripts/docker/dists/ubuntu20/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,10 @@ COPY . .
RUN git clean -fdxx \
&& git reset --hard HEAD

RUN [ -z "$release" ] || git checkout ${release}
ARG release
RUN [ -z "$release" ] || git checkout ${release} ; \
git status ; \
git log -1 --oneline

#
# Install build dependencies
Expand Down
5 changes: 4 additions & 1 deletion scripts/docker/dists/ubuntu22/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,10 @@ COPY . .
RUN git clean -fdxx \
&& git reset --hard HEAD

RUN [ -z "$release" ] || git checkout ${release}
ARG release
RUN [ -z "$release" ] || git checkout ${release} ; \
git status ; \
git log -1 --oneline

#
# Install build dependencies
Expand Down
5 changes: 4 additions & 1 deletion scripts/docker/dists/ubuntu24/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,10 @@ COPY . .
RUN git clean -fdxx \
&& git reset --hard HEAD

RUN [ -z "$release" ] || git checkout ${release}
ARG release
RUN [ -z "$release" ] || git checkout ${release} ; \
git status ; \
git log -1 --oneline

#
# Install build dependencies
Expand Down
32 changes: 30 additions & 2 deletions scripts/docker/docker.mk
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@
# version, DOCKER_COMMIT _must_ also be set.
DOCKER_VERSION := $(RADIUSD_VERSION_STRING)
#
# Commit hash/tag/branch to build, will be taken from VERSION above if not overridden, e.g. "release_3_2_0"
DOCKER_COMMIT := release_$(shell echo $(DOCKER_VERSION) | tr .- __)
# Commit hash/tag/branch to build, if not set then HEAD will be used.
DOCKER_COMMIT :=
#
# Build args, most likely "--no-cache"
DOCKER_BUILD_ARGS :=
Expand Down Expand Up @@ -66,6 +66,34 @@ ifneq "$(DOCKER_REGISTRY)" ""
endif


#
# Print some useful help
#
.PHONY: docker.help.images
docker.help.images:
@echo Available images: $(DOCKER_IMAGES)

.PHONY: docker.help
docker.help: docker.help.images
@echo ""
@echo "Make targets:"
@echo " docker-ubuntu - build main ubuntu image"
@echo " docker-alpine - build main alpine image"
@echo " docker.regen - regenerate all Dockerfiles from templates"
@echo ""
@echo "Make targets per image:"
@echo " docker.IMAGE.build - build image"
@echo " docker.IMAGE.regen - regenerate Dockerfile"
@echo ""
@echo "Arguments:"
@echo ' DOCKER_BUILD_ARGS="--no-cache" - extra build args'
@echo ' DOCKER_REGISTRY="docker.example.com" - registry to build for'
@echo ' DOCKER_REPO="freeradius" - docker repo name'
@echo ' DOCKER_TAG="freeradius-server" - docker tag name'
@echo ' DOCKER_COMMIT="HEAD" - commit/ref to build from'
@echo ' DOCKER_VERSION="$(DOCKER_VERSION)" - version for docker image name'


#
# Rules for each OS
#
Expand Down
5 changes: 4 additions & 1 deletion scripts/docker/m4/Dockerfile.deb.m4
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,10 @@ COPY . .
RUN git clean -fdxx \
&& git reset --hard HEAD

RUN [ -z "$release" ] || git checkout ${release}
ARG release
RUN [ -z "$release" ] || git checkout ${release} ; \
git status ; \
git log -1 --oneline

#
# Install build dependencies
Expand Down
5 changes: 4 additions & 1 deletion scripts/docker/m4/Dockerfile.rpm.m4
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,10 @@ COPY . .
RUN git clean -fdxx \
&& git reset --hard HEAD

RUN [ -z "$release" ] || git checkout ${release}
ARG release
RUN [ -z "$release" ] || git checkout ${release} ; \
git status ; \
git log -1 --oneline

#
# Other requirements
Expand Down

0 comments on commit ad23bc0

Please sign in to comment.