From 833bad3b9492913099c54fb06d3a6a5be9dc97e7 Mon Sep 17 00:00:00 2001 From: Tetsuharu Ohzeki Date: Wed, 8 Jul 2020 08:09:37 +0900 Subject: [PATCH] Use Docker's multi-stage builds --- .dockerignore | 1 - Dockerfile | 11 ++++++----- Makefile | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/.dockerignore b/.dockerignore index ce15bcb..b36678c 100644 --- a/.dockerignore +++ b/.dockerignore @@ -4,4 +4,3 @@ tools/ .gitignore LICENSE.MIT -Makefile diff --git a/Dockerfile b/Dockerfile index ffa1192..5d4dae2 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,9 +1,10 @@ -FROM golang:1.14-buster - +FROM golang:1.14-buster AS builder ADD . /gh-action-detect-unmergeable/ - WORKDIR /gh-action-detect-unmergeable/ -RUN ["go", "build", "-o", "app"] +RUN ["make", "build", "-j"] -ENTRYPOINT ["/gh-action-detect-unmergeable/app"] +FROM debian:buster-20200607-slim +WORKDIR /root/ +COPY --from=builder /gh-action-detect-unmergeable/ghaction_unmergeable_detection . +ENTRYPOINT ["/root/ghaction_unmergeable_detection"] \ No newline at end of file diff --git a/Makefile b/Makefile index fa40930..9eea7ea 100644 --- a/Makefile +++ b/Makefile @@ -1,7 +1,7 @@ GO_CMD := go GO_BUILD := $(GO_CMD) build -DIST_APP_BIN_NAME := app +DIST_APP_BIN_NAME := ghaction_unmergeable_detection all: help