Makefile 2.1 KB
Newer Older
1 2 3 4
# Copyright (c) 2017-2018, NVIDIA CORPORATION. All rights reserved.

DOCKER ?= docker

R
Rajat Chopra 已提交
5
MKDIR ?= mkdir
R
Rajat Chopra 已提交
6

7
VERSION := 1.0.1
8 9 10 11 12 13

DIST_DIR  := $(CURDIR)/../dist

.NOTPARALLEL:
.PHONY: all

R
Rajat Chopra 已提交
14
all: ubuntu18.04 ubuntu16.04 debian9 centos7 amzn2 amzn1
15

R
Renaud Gaubert 已提交
16
ubuntu%: ARCH := amd64
F
Felix Abecassis 已提交
17 18 19
ubuntu%: $(CURDIR)/Dockerfile.ubuntu
	$(DOCKER) build --build-arg VERSION_ID="$*" \
	                --build-arg PKG_VERS="$(VERSION)" \
20
	                --build-arg PKG_REV="1" \
R
Rajat Chopra 已提交
21
	                -t "nvidia/toolkit/ubuntu:$*" -f Dockerfile.ubuntu .
R
Renaud Gaubert 已提交
22
	$(MKDIR) -p $(DIST_DIR)/$@/$(ARCH)
R
Rajat Chopra 已提交
23
	$(DOCKER) run --cidfile $@.cid "nvidia/toolkit/ubuntu:$*"
R
Renaud Gaubert 已提交
24 25
	$(DOCKER) cp $$(cat $@.cid):/dist/. $(DIST_DIR)/$@/$(ARCH)/
	$(DOCKER) rm $$(cat $@.cid) && rm $@.cid
F
Felix Abecassis 已提交
26

R
Renaud Gaubert 已提交
27
debian%: ARCH := amd64
F
Felix Abecassis 已提交
28 29 30
debian%: $(CURDIR)/Dockerfile.debian
	$(DOCKER) build --build-arg VERSION_ID="$*" \
	                --build-arg PKG_VERS="$(VERSION)" \
31
	                --build-arg PKG_REV="1" \
R
Rajat Chopra 已提交
32
	                -t "nvidia/toolkit/debian:$*" -f Dockerfile.debian .
R
Renaud Gaubert 已提交
33
	$(MKDIR) -p $(DIST_DIR)/$@/$(ARCH)
R
Rajat Chopra 已提交
34
	$(DOCKER) run --cidfile $@.cid "nvidia/toolkit/debian:$*"
R
Renaud Gaubert 已提交
35 36
	$(DOCKER) cp $$(cat $@.cid):/dist/. $(DIST_DIR)/$@/$(ARCH)/
	$(DOCKER) rm $$(cat $@.cid) && rm $@.cid
F
Felix Abecassis 已提交
37

R
Renaud Gaubert 已提交
38
centos%: ARCH := x86_64
F
Felix Abecassis 已提交
39 40 41
centos%: $(CURDIR)/Dockerfile.centos
	$(DOCKER) build --build-arg VERSION_ID="$*" \
	                --build-arg PKG_VERS="$(VERSION)" \
42
	                --build-arg PKG_REV="2" \
R
Rajat Chopra 已提交
43
	                -t "nvidia/toolkit/centos:$*" -f Dockerfile.centos .
R
Renaud Gaubert 已提交
44
	$(MKDIR) -p $(DIST_DIR)/$@/$(ARCH)
R
Rajat Chopra 已提交
45
	$(DOCKER) run --cidfile $@.cid "nvidia/toolkit/centos:$*"
R
Renaud Gaubert 已提交
46 47
	$(DOCKER) cp $$(cat $@.cid):/dist/. $(DIST_DIR)/$@/$(ARCH)/
	$(DOCKER) rm $$(cat $@.cid) && rm $@.cid
F
Felix Abecassis 已提交
48

R
Renaud Gaubert 已提交
49
amzn%: ARCH := x86_64
F
Felix Abecassis 已提交
50 51 52
amzn%: $(CURDIR)/Dockerfile.amzn
	$(DOCKER) build --build-arg VERSION_ID="$*" \
	                --build-arg PKG_VERS="$(VERSION)" \
53
	                --build-arg PKG_REV="2.amzn$*" \
R
Rajat Chopra 已提交
54
	                -t "nvidia/toolkit/amzn:$*" -f Dockerfile.amzn .
R
Renaud Gaubert 已提交
55
	$(MKDIR) -p $(DIST_DIR)/$@/$(ARCH)
R
Rajat Chopra 已提交
56
	$(DOCKER) run --cidfile $@.cid "nvidia/toolkit/amzn:$*"
R
Renaud Gaubert 已提交
57 58
	$(DOCKER) cp $$(cat $@.cid):/dist/. $(DIST_DIR)/$@/$(ARCH)/
	$(DOCKER) rm $$(cat $@.cid) && rm $@.cid