From b21d716cbb223442b574907bd55a38e955a030d1 Mon Sep 17 00:00:00 2001 From: Mathieu Deous Date: Thu, 5 Jan 2023 22:42:39 +0100 Subject: Fix docker build (#124) --- Dockerfile | 10 +++++----- Makefile | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/Dockerfile b/Dockerfile index f7d5bc9..69dad20 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,9 +1,9 @@ -FROM golang:alpine as build +FROM golang:alpine AS build WORKDIR /app # install build dependencies RUN apk add --no-cache build-base git && \ - apk add --no-cache -X http://dl-cdn.alpinelinux.org/alpine/edge/testing yara-dev + apk add --no-cache -X https://dl-cdn.alpinelinux.org/alpine/edge/testing yara-dev # copy and build PMF COPY . . @@ -14,10 +14,10 @@ LABEL org.opencontainers.image.source="https://github.com/jvoisin/php-malware-fi WORKDIR /app # install dependencies -RUN apk add --no-cache libressl +RUN apk add --no-cache libressl && \ + apk add --no-cache -X https://dl-cdn.alpinelinux.org/alpine/edge/testing yara -# copy files from build container -COPY --from=build /usr/local/lib /usr/lib +# copy binary from build container COPY --from=build /app/php-malware-finder /app ENTRYPOINT ["/app/php-malware-finder", "-v", "-a", "-c", "/data"] diff --git a/Makefile b/Makefile index 8cdf2fd..d5b9661 100644 --- a/Makefile +++ b/Makefile @@ -34,7 +34,7 @@ tests: php-malware-finder ## Run test suite docker: ## Build docker image docker pull $(IMAGE_NAME):latest || true - docker build --pull -t $(IMAGE_NAME):latest . + docker build --pull --cache-from=$(IMAGE_NAME):latest -t $(IMAGE_NAME):latest . docker tag $(IMAGE_NAME):latest $(IMAGE_NAME):$(IMAGE_VERSION) docker-tests: ## Run docker image against the samples folder -- cgit v1.3