From 65fc49eee21aefc19a03f4fd5cd80f35bef22f17 Mon Sep 17 00:00:00 2001 From: Michel Oosterhof Date: Mon, 9 Jan 2023 13:24:46 +0800 Subject: [PATCH] arm64 builds (#1805) --- Makefile | 12 +++++++----- docker/Dockerfile | 8 ++++---- 2 files changed, 11 insertions(+), 9 deletions(-) diff --git a/Makefile b/Makefile index 13807340..6b54c648 100644 --- a/Makefile +++ b/Makefile @@ -73,16 +73,18 @@ REGISTRY ?= cowrie IMAGE := $(REGISTRY)/$(MODULE) -IMAGENAME := cowrie/cowrie CONTAINERNAME := cowrie +PLATFORM := linux/amd64,linux/arm64 BUILD_DATE = $(shell date -u +'%Y-%m-%dT%H:%M:%SZ') TAG=$(shell git rev-parse --short=8 HEAD) + .PHONY: docker-build docker-build: docker/Dockerfile ## Build Docker image - #docker build -t ${IMAGENAME}:${TAG} --no-cache --build-arg TAG=${TAG} --build-arg BUILD_DATE=${BUILD_DATE} -f docker/Dockerfile . - $(DOCKER) build -t ${IMAGENAME}:${TAG} --build-arg BUILD_DATE=${BUILD_DATE} -f docker/Dockerfile . + -$(DOCKER) buildx create --name cowrie-builder + $(DOCKER) buildx use cowrie-builder + $(DOCKER) buildx build --platform ${PLATFORM} -t ${IMAGE}:${TAG} --build-arg BUILD_DATE=${BUILD_DATE} -f docker/Dockerfile --push . .PHONY: docker-run docker-run: docker-start ## Run Docker container @@ -103,7 +105,7 @@ docker-start: docker-create-volumes ## Start Docker container -d \ --cap-drop=ALL \ --read-only \ - --name ${CONTAINERNAME} ${IMAGENAME}:${TAG} + --name ${CONTAINERNAME} ${IMAGE}:${TAG} .PHONY: docker-stop docker-stop: ## Stop Docker Container @@ -115,7 +117,7 @@ docker-rm: docker-stop ## Delete Docker Container .PHONY: docker-clean docker-clean: docker-rm ## Clean - $(DOCKER) rmi ${IMAGENAME}:${TAG} + $(DOCKER) rmi ${IMAGE}:${TAG} .PHONY: docker-shell docker-shell: ## Start shell in running Docker container diff --git a/docker/Dockerfile b/docker/Dockerfile index c51211c3..dbd606bc 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -65,16 +65,16 @@ COPY --chown=${COWRIE_USER}:${COWRIE_GROUP} . ${COWRIE_HOME}/cowrie-git FROM gcr.io/distroless/python3-debian11 AS runtime #FROM gcr.io/distroless/python3-debian11:debug AS runtime -LABEL org.opencontainers.image.created="${BUILD_DATE}" +LABEL org.opencontainers.image.created=${BUILD_DATE} LABEL org.opencontainers.image.authors="Michel Oosterhof " LABEL org.opencontainers.image.url="https://cowrie.org/" LABEL org.opencontainers.image.documentation="https://cowrie.readthedocs.io" -LABEL org.opencontainers.image.source="https://github.com/cowrie/docker-cowrie" -LABEL org.opencontainers.image.version="${TAG}" +LABEL org.opencontainers.image.source="https://github.com/cowrie/cowrie" +LABEL org.opencontainers.image.version=${TAG} LABEL org.opencontainers.image.revision="Source control revision identifier for the packaged software." LABEL org.opencontainers.image.vendor="Cowrie" LABEL org.opencontainers.image.licenses="BSD-3-Clause" -LABEL org.opencontainers.image.ref.name="${TAG}" +LABEL org.opencontainers.image.ref.name=${TAG} LABEL org.opencontainers.image.title="Cowrie SSH/Telnet Honeypot" LABEL org.opencontainers.image.description="Cowrie SSH/Telnet Honeypot" #LABEL org.opencontainers.image.base.digest="7beb0248fd81"