From 65e7093ee79be30951814ef1802018a4126cf481 Mon Sep 17 00:00:00 2001 From: Jelmer Snoeck Date: Thu, 15 Feb 2018 16:49:34 +0100 Subject: [PATCH] Use scratch image for container. By disabling CGO, we can use the `scratch` image instead of the `fedora` image, allowing a lighter weight image. --- Dockerfile | 5 ++--- Makefile | 2 +- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/Dockerfile b/Dockerfile index 9772958d4..74a620037 100644 --- a/Dockerfile +++ b/Dockerfile @@ -11,10 +11,9 @@ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. - -FROM fedora +FROM scratch MAINTAINER Avesh Agarwal COPY _output/bin/descheduler /bin/descheduler -CMD ["/bin/descheduler --help"] +CMD ["/bin/descheduler", "--help"] diff --git a/Makefile b/Makefile index b00e53c72..32c558c80 100644 --- a/Makefile +++ b/Makefile @@ -30,7 +30,7 @@ IMAGE:=descheduler:$(VERSION) all: build build: - go build ${LDFLAGS} -o _output/bin/descheduler github.com/kubernetes-incubator/descheduler/cmd/descheduler + CGO_ENABLED=0 go build ${LDFLAGS} -o _output/bin/descheduler github.com/kubernetes-incubator/descheduler/cmd/descheduler image: build docker build -t $(IMAGE) .