Skip to content

Commit 9b6e0fb

Browse files
committed
Updated docker build
1 parent 0b8fb0f commit 9b6e0fb

File tree

2 files changed

+11
-4
lines changed

2 files changed

+11
-4
lines changed

Makefile

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,25 +44,32 @@ all: clean build
4444
###############################################################################
4545
# BUILD
4646

47-
# Build the commands in the cmd directory
47+
# Compile NPM and build the commands in the cmd directory
4848
.PHONY: build
49-
build: tidy $(NPM_DIR) $(PLUGIN_DIR) $(CMD_DIR)
49+
build: $(NPM_DIR) build-docker
50+
51+
# Build the commands in the cmd directory
52+
.PHONY: build-docker
53+
build-docker: tidy $(PLUGIN_DIR) $(CMD_DIR)
5054

55+
# Build the commands
5156
$(CMD_DIR): go-dep mkdir
5257
@echo Build command $(notdir $@) GOOS=${OS} GOARCH=${ARCH}
5358
@GOOS=${OS} GOARCH=${ARCH} ${GO} build ${BUILD_FLAGS} -o ${BUILD_DIR}/$(notdir $@) ./$@
5459

60+
# Build the plugins
5561
$(PLUGIN_DIR): go-dep mkdir
5662
@echo Build plugin $(notdir $@) GOOS=${OS} GOARCH=${ARCH}
5763
@GOOS=${OS} GOARCH=${ARCH} ${GO} build -buildmode=plugin ${BUILD_FLAGS} -o ${BUILD_DIR}/$(notdir $@).plugin ./$@
5864

65+
# Build the NPM packages
5966
$(NPM_DIR): npm-dep
6067
@echo Build npm $(notdir $@)
6168
@cd $@ && npm install && npm run prod
6269

6370
# Build the docker image
6471
.PHONY: docker
65-
docker: docker-dep
72+
docker: docker-dep ${NPM_DIR}
6673
@echo build docker image ${DOCKER_TAG} OS=${OS} ARCH=${ARCH} SOURCE=${DOCKER_SOURCE} VERSION=${VERSION}
6774
@${DOCKER} build \
6875
--tag ${DOCKER_TAG} \

etc/docker/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ COPY . .
1111
# Build the server
1212
RUN \
1313
apt update -y && apt upgrade -y && \
14-
OS=${OS} ARCH=${ARCH} make build
14+
OS=${OS} ARCH=${ARCH} make build-docker
1515

1616
# Copy binaries to /usr/local/bin
1717
FROM --platform=${OS}/${ARCH} debian:bookworm-slim

0 commit comments

Comments
 (0)