Skip to content

Commit dc1dc6d

Browse files
committed
Clean up multiarch builds
- Use --pull to force pull of base ubuntu image - No longer need to do a docker pull now that buildx is being called with --pull - Don't rebuild locally, just do a pull after baking multiarch Signed-off-by: Joe Block <jpb@unixorn.net>
1 parent d2190fd commit dc1dc6d

File tree

1 file changed

+25
-26
lines changed

1 file changed

+25
-26
lines changed

Makefile

Lines changed: 25 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -26,40 +26,39 @@ PLATFORMS=linux/arm64,linux/amd64,linux/arm/v7
2626
install_hooks: ## Install the git hooks
2727
poetry run pre-commit install
2828

29-
pull:
30-
docker pull ubuntu:22.04
29+
local_cgiserver: ## Makes a moosefs-cgiserver docker image for only the architecture we're running on. Does not push to dockerhub.
30+
docker buildx build --pull --load -t ${HUB_USER}/moosefs-cgiserver -f Dockerfile.cgiserver .
3131

32-
local_cgiserver: pull ## Makes a moosefs-cgiserver docker image for only the architecture we're running on. Does not push to dockerhub.
33-
docker buildx build --load -t ${HUB_USER}/moosefs-cgiserver -f Dockerfile.cgiserver .
32+
multiarch_cgiserver: ## Makes a moosefs-cgiserver multi-architecture docker image for linux/arm64, linux/amd64 and linux/arm/v7 and pushes it to dockerhub
33+
docker buildx build --build-arg application_version=${MOOSEFS_VERSION} --platform ${PLATFORMS} --pull --push -t ${HUB_USER}/moosefs-cgiserver:$(MOOSEFS_VERSION) -f Dockerfile.cgiserver .
34+
docker buildx build --build-arg application_version=${MOOSEFS_VERSION} --platform ${PLATFORMS} --pull --push -t ${HUB_USER}/moosefs-cgiserver:latest -f Dockerfile.cgiserver .
35+
docker pull ${HUB_USER}/moosefs-cgiserver:latest
3436

35-
multiarch_cgiserver: pull ## Makes a moosefs-cgiserver multi-architecture docker image for linux/arm64, linux/amd64 and linux/arm/v7 and pushes it to dockerhub
36-
docker buildx build --build-arg application_version=${MOOSEFS_VERSION} --platform ${PLATFORMS} --push -t ${HUB_USER}/moosefs-cgiserver:$(MOOSEFS_VERSION) -f Dockerfile.cgiserver .
37-
docker buildx build --build-arg application_version=${MOOSEFS_VERSION} --platform ${PLATFORMS} --push -t ${HUB_USER}/moosefs-cgiserver:latest -f Dockerfile.cgiserver .
38-
make local_cgiserver
3937

40-
local_chunkserver: pull ## Makes a moosefs-chunkserver docker image for only the architecture we're running on. Does not push to dockerhub.
41-
docker buildx build --load -t ${HUB_USER}/moosefs-chunkserver -f Dockerfile.chunkserver .
38+
local_chunkserver: ## Makes a moosefs-chunkserver docker image for only the architecture we're running on. Does not push to dockerhub.
39+
docker buildx build --pull --load -t ${HUB_USER}/moosefs-chunkserver -f Dockerfile.chunkserver .
4240

43-
multiarch_chunkserver: pull ## Makes a moosefs-chunkserver multi-architecture docker image for linux/arm64, linux/amd64 and linux/arm/v7 and pushes it to dockerhub
44-
docker buildx build --build-arg application_version=${MOOSEFS_VERSION} --platform ${PLATFORMS} --push -t ${HUB_USER}/moosefs-chunkserver:$(MOOSEFS_VERSION) -f Dockerfile.chunkserver .
45-
docker buildx build --build-arg application_version=${MOOSEFS_VERSION} --platform ${PLATFORMS} --push -t ${HUB_USER}/moosefs-chunkserver:latest -f Dockerfile.chunkserver .
46-
make local_chunkserver
41+
multiarch_chunkserver: ## Makes a moosefs-chunkserver multi-architecture docker image for linux/arm64, linux/amd64 and linux/arm/v7 and pushes it to dockerhub
42+
docker buildx build --build-arg application_version=${MOOSEFS_VERSION} --platform ${PLATFORMS} --pull --push -t ${HUB_USER}/moosefs-chunkserver:$(MOOSEFS_VERSION) -f Dockerfile.chunkserver .
43+
docker buildx build --build-arg application_version=${MOOSEFS_VERSION} --platform ${PLATFORMS} --pull --push -t ${HUB_USER}/moosefs-chunkserver:latest -f Dockerfile.chunkserver .
44+
docker pull ${HUB_USER}/moosefs-chunkserver:latest
4745

48-
local_master: pull ## Makes a moosefs-master docker image for only the architecture we're running on. Does not push to dockerhub.
49-
docker buildx build --load -t ${HUB_USER}/moosefs-master -f Dockerfile.master .
5046

51-
multiarch_master: pull ## Makes a moosefs-master multi-architecture docker image for linux/arm64, linux/amd64 and linux/arm/v7 and pushes it to dockerhub
52-
docker buildx build --build-arg application_version=${MOOSEFS_VERSION} --platform ${PLATFORMS} --push -t ${HUB_USER}/moosefs-master:$(MOOSEFS_VERSION) -f Dockerfile.master .
53-
docker buildx build --build-arg application_version=${MOOSEFS_VERSION} --platform ${PLATFORMS} --push -t ${HUB_USER}/moosefs-master:latest -f Dockerfile.master .
54-
make local_master
47+
local_master: ## Makes a moosefs-master docker image for only the architecture we're running on. Does not push to dockerhub.
48+
docker buildx build --pull --load -t ${HUB_USER}/moosefs-master -f Dockerfile.master .
5549

56-
local_metalogger: pull ## Makes a moosefs-metalogger docker image for only the architecture we're running on. Does not push to dockerhub.
57-
docker buildx build --load -t ${HUB_USER}/moosefs-metalogger -f Dockerfile.metalogger .
50+
multiarch_master: ## Makes a moosefs-master multi-architecture docker image for linux/arm64, linux/amd64 and linux/arm/v7 and pushes it to dockerhub
51+
docker buildx build --build-arg application_version=${MOOSEFS_VERSION} --platform ${PLATFORMS} --pull --push -t ${HUB_USER}/moosefs-master:$(MOOSEFS_VERSION) -f Dockerfile.master .
52+
docker buildx build --build-arg application_version=${MOOSEFS_VERSION} --platform ${PLATFORMS} --pull --push -t ${HUB_USER}/moosefs-master:latest -f Dockerfile.master .
53+
docker pull ${HUB_USER}/moosefs-master:latest
5854

59-
multiarch_metalogger: pull ## Makes a moosefs-metalogger multi-architecture docker image for linux/arm64, linux/amd64 and linux/arm/v7 and pushes it to dockerhub
60-
docker buildx build --build-arg application_version=${MOOSEFS_VERSION} --platform ${PLATFORMS} --push -t ${HUB_USER}/moosefs-metalogger:$(MOOSEFS_VERSION) -f Dockerfile.metalogger .
61-
docker buildx build --build-arg application_version=${MOOSEFS_VERSION} --platform ${PLATFORMS} --push -t ${HUB_USER}/moosefs-metalogger:latest -f Dockerfile.metalogger .
62-
make local_metalogger
55+
local_metalogger: ## Makes a moosefs-metalogger docker image for only the architecture we're running on. Does not push to dockerhub.
56+
docker buildx build --pull --load -t ${HUB_USER}/moosefs-metalogger -f Dockerfile.metalogger .
57+
58+
multiarch_metalogger: ## Makes a moosefs-metalogger multi-architecture docker image for linux/arm64, linux/amd64 and linux/arm/v7 and pushes it to dockerhub
59+
docker buildx build --build-arg application_version=${MOOSEFS_VERSION} --platform ${PLATFORMS} --pull --push -t ${HUB_USER}/moosefs-metalogger:$(MOOSEFS_VERSION) -f Dockerfile.metalogger .
60+
docker buildx build --build-arg application_version=${MOOSEFS_VERSION} --platform ${PLATFORMS} --pull --push -t ${HUB_USER}/moosefs-metalogger:latest -f Dockerfile.metalogger .
61+
docker pull ${HUB_USER}/moosefs-metalogger:latest
6362

6463
local: local_cgiserver \ ## Make images for whatever architecture you're running on, but does not push to docker hub
6564
local_chunkserver \

0 commit comments

Comments
 (0)