Skip to content

Commit 8e766a2

Browse files
committed
tooling: Add targets to Makefile.docker for building and running dev container
1 parent c0e9c04 commit 8e766a2

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

Makefile.docker

+11
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ DOCKER := DOCKER_BUILDKIT=1 docker
1212
DOCKER_IMAGE_NAME := cloe/cloe-engine
1313
DOCKER_IMAGE_VERSION := ${PROJECT_VERSION}
1414
DOCKER_IMAGE := ${DOCKER_IMAGE_NAME}:${DOCKER_IMAGE_VERSION}
15+
DOCKER_DEVIMAGE := ${DOCKER_IMAGE_NAME}-dev:${DOCKER_IMAGE_VERSION}
1516
DOCKER_CONTEXT := ${PROJECT_ROOT}
1617

1718
DOCKER_USER_ARGS +=
@@ -115,6 +116,13 @@ ubuntu-%: FORCE build-ubuntu-% test-ubuntu-%
115116
.PHONY: all
116117
all: $(addprefix ubuntu-,${UBUNTU_VERSIONS})
117118

119+
build-devc-%: FORCE Dockerfile
120+
${DOCKER} build -f Dockerfile ${DOCKER_BUILD_ARGS} ${DOCKER_USER_ARGS} \
121+
--build-arg UBUNTU_VERSION=$* \
122+
--target stage-setup-system \
123+
-t ${DOCKER_DEVIMAGE}-ubuntu-$* \
124+
${DOCKER_CONTEXT}
125+
118126
build-ubuntu-%: FORCE Dockerfile
119127
${DOCKER} build -f Dockerfile ${DOCKER_BUILD_ARGS} ${DOCKER_USER_ARGS} \
120128
--build-arg UBUNTU_VERSION=$* \
@@ -125,6 +133,9 @@ test-ubuntu-%: FORCE
125133
docker run ${DOCKER_RUN_ARGS} ${DOCKER_USER_ARGS} ${DOCKER_IMAGE}-ubuntu-$* \
126134
bash -ec "[ -f /root/setup.sh ] && source /root/setup.sh; make smoketest"
127135

136+
run-devc-%: FORCE
137+
docker run -it ${DOCKER_RUN_ARGS} ${DOCKER_USER_ARGS} --mount type=bind,source=$$(pwd),destination=/cloe ${DOCKER_DEVIMAGE}-ubuntu-$*
138+
128139
run-ubuntu-%: FORCE
129140
docker run -it ${DOCKER_RUN_ARGS} ${DOCKER_USER_ARGS} ${DOCKER_IMAGE}-ubuntu-$*
130141

0 commit comments

Comments
 (0)