diff options
| -rw-r--r-- | Dockerfile | 10 | ||||
| -rw-r--r-- | Makefile | 2 |
2 files changed, 6 insertions, 6 deletions
| @@ -1,9 +1,9 @@ | |||
| 1 | FROM golang:alpine as build | 1 | FROM golang:alpine AS build |
| 2 | WORKDIR /app | 2 | WORKDIR /app |
| 3 | 3 | ||
| 4 | # install build dependencies | 4 | # install build dependencies |
| 5 | RUN apk add --no-cache build-base git && \ | 5 | RUN apk add --no-cache build-base git && \ |
| 6 | apk add --no-cache -X http://dl-cdn.alpinelinux.org/alpine/edge/testing yara-dev | 6 | apk add --no-cache -X https://dl-cdn.alpinelinux.org/alpine/edge/testing yara-dev |
| 7 | 7 | ||
| 8 | # copy and build PMF | 8 | # copy and build PMF |
| 9 | COPY . . | 9 | COPY . . |
| @@ -14,10 +14,10 @@ LABEL org.opencontainers.image.source="https://github.com/jvoisin/php-malware-fi | |||
| 14 | WORKDIR /app | 14 | WORKDIR /app |
| 15 | 15 | ||
| 16 | # install dependencies | 16 | # install dependencies |
| 17 | RUN apk add --no-cache libressl | 17 | RUN apk add --no-cache libressl && \ |
| 18 | apk add --no-cache -X https://dl-cdn.alpinelinux.org/alpine/edge/testing yara | ||
| 18 | 19 | ||
| 19 | # copy files from build container | 20 | # copy binary from build container |
| 20 | COPY --from=build /usr/local/lib /usr/lib | ||
| 21 | COPY --from=build /app/php-malware-finder /app | 21 | COPY --from=build /app/php-malware-finder /app |
| 22 | 22 | ||
| 23 | ENTRYPOINT ["/app/php-malware-finder", "-v", "-a", "-c", "/data"] | 23 | ENTRYPOINT ["/app/php-malware-finder", "-v", "-a", "-c", "/data"] |
| @@ -34,7 +34,7 @@ tests: php-malware-finder ## Run test suite | |||
| 34 | 34 | ||
| 35 | docker: ## Build docker image | 35 | docker: ## Build docker image |
| 36 | docker pull $(IMAGE_NAME):latest || true | 36 | docker pull $(IMAGE_NAME):latest || true |
| 37 | docker build --pull -t $(IMAGE_NAME):latest . | 37 | docker build --pull --cache-from=$(IMAGE_NAME):latest -t $(IMAGE_NAME):latest . |
| 38 | docker tag $(IMAGE_NAME):latest $(IMAGE_NAME):$(IMAGE_VERSION) | 38 | docker tag $(IMAGE_NAME):latest $(IMAGE_NAME):$(IMAGE_VERSION) |
| 39 | 39 | ||
| 40 | docker-tests: ## Run docker image against the samples folder | 40 | docker-tests: ## Run docker image against the samples folder |
