2020-04-12 00:18:00 +00:00
|
|
|
# Copyright (c) 2017-2020, NVIDIA CORPORATION. All rights reserved.
|
2019-10-22 21:36:22 +00:00
|
|
|
|
|
|
|
DOCKER ?= docker
|
|
|
|
MKDIR ?= mkdir
|
2020-04-12 00:18:00 +00:00
|
|
|
REGISTRY ?= nvidia/container-toolkit
|
2019-10-22 21:36:22 +00:00
|
|
|
|
2020-04-12 00:18:00 +00:00
|
|
|
GOLANG_VERSION := 1.14.2
|
2019-10-22 21:36:22 +00:00
|
|
|
VERSION := 1.0.5
|
|
|
|
DIST_DIR := $(CURDIR)/dist
|
|
|
|
|
2020-04-12 00:18:00 +00:00
|
|
|
TOOLKIT=nvidia-container-toolkit
|
|
|
|
|
|
|
|
include $(CURDIR)/docker.mk
|
|
|
|
|
2019-10-22 21:36:22 +00:00
|
|
|
.PHONY: all
|
|
|
|
|
|
|
|
all: ubuntu18.04 ubuntu16.04 debian10 debian9 centos7 amzn2 amzn1 opensuse-leap15.1
|
|
|
|
|
2020-04-12 00:18:00 +00:00
|
|
|
binary:
|
|
|
|
go build -ldflags "-s -w" -o "$(TOOLKIT)" github.com/NVIDIA/container-toolkit/pkg
|
|
|
|
|
2019-10-22 21:36:22 +00:00
|
|
|
push%:
|
2019-10-22 23:11:35 +00:00
|
|
|
docker push "$(REGISTRY)/$*"
|
2019-10-22 21:36:22 +00:00
|
|
|
|
|
|
|
ubuntu%: ARCH := amd64
|
|
|
|
ubuntu%:
|
|
|
|
$(DOCKER) build --pull \
|
|
|
|
--build-arg GOLANG_VERSION="$(GOLANG_VERSION)" \
|
|
|
|
--build-arg VERSION_ID="$*" \
|
|
|
|
--build-arg PKG_VERS="$(VERSION)" \
|
|
|
|
--build-arg PKG_REV="1" \
|
2019-10-22 23:11:35 +00:00
|
|
|
--tag "$(REGISTRY)/ubuntu$*" \
|
2019-10-22 21:36:22 +00:00
|
|
|
--file docker/Dockerfile.ubuntu .
|
|
|
|
$(MKDIR) -p $(DIST_DIR)/$@/$(ARCH)
|
2019-10-22 23:11:35 +00:00
|
|
|
$(DOCKER) run --cidfile $@.cid "$(REGISTRY)/ubuntu$*"
|
2019-10-22 21:36:22 +00:00
|
|
|
$(DOCKER) cp $$(cat $@.cid):/dist/. $(DIST_DIR)/$@/$(ARCH)/
|
|
|
|
$(DOCKER) rm $$(cat $@.cid) && rm $@.cid
|
|
|
|
|
|
|
|
debian%: ARCH := amd64
|
|
|
|
debian%:
|
|
|
|
$(DOCKER) build --pull \
|
|
|
|
--build-arg GOLANG_VERSION="$(GOLANG_VERSION)" \
|
|
|
|
--build-arg VERSION_ID="$*" \
|
|
|
|
--build-arg PKG_VERS="$(VERSION)" \
|
|
|
|
--build-arg PKG_REV="1" \
|
2019-10-22 23:11:35 +00:00
|
|
|
--tag "$(REGISTRY)/debian$*" \
|
2019-10-22 21:36:22 +00:00
|
|
|
--file docker/Dockerfile.debian .
|
|
|
|
$(MKDIR) -p $(DIST_DIR)/$@/$(ARCH)
|
2019-10-22 23:11:35 +00:00
|
|
|
$(DOCKER) run --cidfile $@.cid "$(REGISTRY)/debian$*"
|
2019-10-22 21:36:22 +00:00
|
|
|
$(DOCKER) cp $$(cat $@.cid):/dist/. $(DIST_DIR)/$@/$(ARCH)/
|
|
|
|
$(DOCKER) rm $$(cat $@.cid) && rm $@.cid
|
|
|
|
|
|
|
|
centos%: ARCH := x86_64
|
|
|
|
centos%:
|
|
|
|
$(DOCKER) build --pull \
|
|
|
|
--build-arg GOLANG_VERSION="$(GOLANG_VERSION)" \
|
|
|
|
--build-arg VERSION_ID="$*" \
|
|
|
|
--build-arg PKG_VERS="$(VERSION)" \
|
|
|
|
--build-arg PKG_REV="2" \
|
2019-10-22 23:11:35 +00:00
|
|
|
--tag "$(REGISTRY)/centos$*" \
|
2019-10-22 21:36:22 +00:00
|
|
|
--file docker/Dockerfile.centos .
|
|
|
|
$(MKDIR) -p $(DIST_DIR)/$@/$(ARCH)
|
2019-10-22 23:11:35 +00:00
|
|
|
$(DOCKER) run --cidfile $@.cid "$(REGISTRY)/centos$*"
|
2019-10-22 21:36:22 +00:00
|
|
|
$(DOCKER) cp $$(cat $@.cid):/dist/. $(DIST_DIR)/$@/$(ARCH)/
|
|
|
|
$(DOCKER) rm $$(cat $@.cid) && rm $@.cid
|
|
|
|
|
|
|
|
amzn%: ARCH := x86_64
|
|
|
|
amzn%:
|
|
|
|
$(DOCKER) build --pull \
|
|
|
|
--build-arg GOLANG_VERSION="$(GOLANG_VERSION)" \
|
|
|
|
--build-arg VERSION_ID="$*" \
|
|
|
|
--build-arg PKG_VERS="$(VERSION)" \
|
|
|
|
--build-arg PKG_REV="2.amzn$*" \
|
2019-10-22 23:11:35 +00:00
|
|
|
--tag "$(REGISTRY)/amzn$*" \
|
2019-10-22 21:36:22 +00:00
|
|
|
--file docker/Dockerfile.amzn .
|
|
|
|
$(MKDIR) -p $(DIST_DIR)/$@/$(ARCH)
|
2019-10-22 23:11:35 +00:00
|
|
|
$(DOCKER) run --cidfile $@.cid "$(REGISTRY)/amzn$*"
|
2019-10-22 21:36:22 +00:00
|
|
|
$(DOCKER) cp $$(cat $@.cid):/dist/. $(DIST_DIR)/$@/$(ARCH)/
|
|
|
|
$(DOCKER) rm $$(cat $@.cid) && rm $@.cid
|
|
|
|
|
|
|
|
opensuse-leap%: ARCH := x86_64
|
|
|
|
opensuse-leap%:
|
|
|
|
$(DOCKER) build --pull \
|
|
|
|
--build-arg GOLANG_VERSION="$(GOLANG_VERSION)" \
|
|
|
|
--build-arg VERSION_ID="$*" \
|
|
|
|
--build-arg PKG_VERS="$(VERSION)" \
|
|
|
|
--build-arg PKG_REV="1" \
|
2019-10-22 23:11:35 +00:00
|
|
|
--tag "$(REGISTRY)/opensuse-leap$*" \
|
2019-10-22 21:36:22 +00:00
|
|
|
--file docker/Dockerfile.opensuse-leap .
|
|
|
|
$(MKDIR) -p $(DIST_DIR)/$@/$(ARCH)
|
2019-10-22 23:11:35 +00:00
|
|
|
$(DOCKER) run --cidfile $@.cid "$(REGISTRY)/opensuse-leap$*"
|
2019-10-22 21:36:22 +00:00
|
|
|
$(DOCKER) cp $$(cat $@.cid):/dist/. $(DIST_DIR)/$@/$(ARCH)/
|
|
|
|
$(DOCKER) rm $$(cat $@.cid) && rm $@.cid
|