From 35c65590138a8162b0788a3ad65b7d63a4afb5a2 Mon Sep 17 00:00:00 2001 From: Evan Lezar Date: Mon, 6 Sep 2021 13:41:57 +0200 Subject: [PATCH] Make all commands and copy executables Signed-off-by: Evan Lezar --- Makefile | 5 ++--- docker/Dockerfile.amazonlinux | 5 +++-- docker/Dockerfile.centos | 5 +++-- docker/Dockerfile.debian | 5 +++-- docker/Dockerfile.opensuse-leap | 5 +++-- docker/Dockerfile.ubuntu | 5 +++-- 6 files changed, 17 insertions(+), 13 deletions(-) diff --git a/Makefile b/Makefile index f04ce31b..16e86e61 100644 --- a/Makefile +++ b/Makefile @@ -43,7 +43,7 @@ CMD_TARGETS := $(patsubst %,cmd-%, $(CMDS)) $(info CMD_TARGETS=$(CMD_TARGETS)) CHECK_TARGETS := assert-fmt vet lint ineffassign misspell -MAKE_TARGETS := binary build all check fmt lint-internal test examples cmds coverage generate $(CHECK_TARGETS) +MAKE_TARGETS := binaries build all check fmt lint-internal test examples cmds coverage generate $(CHECK_TARGETS) TARGETS := $(MAKE_TARGETS) $(EXAMPLE_TARGETS) $(CMD_TARGETS) @@ -52,8 +52,7 @@ DOCKER_TARGETS := $(patsubst %,docker-%, $(TARGETS)) GOOS ?= linux -binary: cmd-nvidia-container-toolkit - +binaries: cmds cmds: $(CMD_TARGETS) $(CMD_TARGETS): cmd-%: GOOS=$(GOOS) go build -ldflags "-s -w" $(MODULE)/cmd/$(*) diff --git a/docker/Dockerfile.amazonlinux b/docker/Dockerfile.amazonlinux index 46af3780..9ddbbfe5 100644 --- a/docker/Dockerfile.amazonlinux +++ b/docker/Dockerfile.amazonlinux @@ -40,8 +40,9 @@ RUN mkdir -p $DIST_DIR /dist WORKDIR $GOPATH/src/nvidia-container-toolkit COPY . . -RUN make binary && \ - mv ./nvidia-container-toolkit $DIST_DIR/nvidia-container-toolkit +RUN make cmds && \ + mv ./nvidia-container-toolkit $DIST_DIR/nvidia-container-toolkit && \ + mv ./nvidia-container-runtime $DIST_DIR/nvidia-container-runtime COPY config/config.toml.amzn $DIST_DIR/config.toml diff --git a/docker/Dockerfile.centos b/docker/Dockerfile.centos index ee1ec486..d800a3c5 100644 --- a/docker/Dockerfile.centos +++ b/docker/Dockerfile.centos @@ -40,8 +40,9 @@ RUN mkdir -p $DIST_DIR /dist WORKDIR $GOPATH/src/nvidia-container-toolkit COPY . . -RUN make binary && \ - mv ./nvidia-container-toolkit $DIST_DIR/nvidia-container-toolkit +RUN make cmds && \ + mv ./nvidia-container-toolkit $DIST_DIR/nvidia-container-toolkit && \ + mv ./nvidia-container-runtime $DIST_DIR/nvidia-container-runtime COPY config/config.toml.centos $DIST_DIR/config.toml diff --git a/docker/Dockerfile.debian b/docker/Dockerfile.debian index 8329dfb9..93acf8aa 100644 --- a/docker/Dockerfile.debian +++ b/docker/Dockerfile.debian @@ -48,8 +48,9 @@ RUN mkdir -p $DIST_DIR /dist WORKDIR $GOPATH/src/nvidia-container-toolkit COPY . . -RUN make binary && \ - mv ./nvidia-container-toolkit $DIST_DIR/nvidia-container-toolkit +RUN make cmds && \ + mv ./nvidia-container-toolkit $DIST_DIR/nvidia-container-toolkit && \ + mv ./nvidia-container-runtime $DIST_DIR/nvidia-container-runtime COPY config/config.toml.debian $DIST_DIR/config.toml diff --git a/docker/Dockerfile.opensuse-leap b/docker/Dockerfile.opensuse-leap index c9ac070a..66e047e3 100644 --- a/docker/Dockerfile.opensuse-leap +++ b/docker/Dockerfile.opensuse-leap @@ -39,8 +39,9 @@ RUN mkdir -p $DIST_DIR /dist WORKDIR $GOPATH/src/nvidia-container-toolkit COPY . . -RUN make binary && \ - mv ./nvidia-container-toolkit $DIST_DIR/nvidia-container-toolkit +RUN make cmds && \ + mv ./nvidia-container-toolkit $DIST_DIR/nvidia-container-toolkit && \ + mv ./nvidia-container-runtime $DIST_DIR/nvidia-container-runtime # Hook for Project Atomic's fork of Docker: https://github.com/projectatomic/docker/tree/docker-1.13.1-rhel#add-dockerhooks-exec-custom-hooks-for-prestartpoststop-containerspatch COPY oci-nvidia-hook $DIST_DIR/oci-nvidia-hook diff --git a/docker/Dockerfile.ubuntu b/docker/Dockerfile.ubuntu index 649cdf3a..9bd85b46 100644 --- a/docker/Dockerfile.ubuntu +++ b/docker/Dockerfile.ubuntu @@ -46,8 +46,9 @@ RUN mkdir -p $DIST_DIR /dist WORKDIR $GOPATH/src/nvidia-container-toolkit COPY . . -RUN make binary && \ - mv ./nvidia-container-toolkit $DIST_DIR/nvidia-container-toolkit +RUN make cmds && \ + mv ./nvidia-container-toolkit $DIST_DIR/nvidia-container-toolkit && \ + mv ./nvidia-container-runtime $DIST_DIR/nvidia-container-runtime COPY config/config.toml.ubuntu $DIST_DIR/config.toml