arm64 builds (#1805)

This commit is contained in:
Michel Oosterhof 2023-01-09 13:24:46 +08:00 committed by GitHub
parent 0d2817a38b
commit 65fc49eee2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 11 additions and 9 deletions

View File

@ -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

View File

@ -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 <michel@oosterhof.net>"
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"