-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMakefile
61 lines (51 loc) · 1.94 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
SHELL := /bin/bash
BASE_IMAGE_VERSION = 11.1.1-cudnn8-devel-ubuntu18.04
IMAGE_NAME := minhocomcomai/tensorflow-pytorch-cuda
IMAGE_VERSION := tf2.4.1-pytorch1.8.1-cuda$(BASE_IMAGE_VERSION)
BUILD_DATE := $(shell date -u +"%Y-%m-%dT%H:%M:%SZ")
VCS_REF := $(shell git rev-parse --short HEAD)
VERSION := $(IMAGE_VERSION)
VCS_BRANCH := $(shell git rev-parse --abbrev-ref HEAD)
VCS_DESCRIBED := $(shell git describe --tags --dirty)
HOSTNAME := $(shell hostname)
all: base customized
base:
docker build \
-f Dockerfile.base \
--build-arg IMAGE_NAME="$(IMAGE_NAME)" \
--build-arg BASE_IMAGE_VERSION="$(BASE_IMAGE_VERSION)" \
--build-arg BUILD_DATE="$(BUILD_DATE)" \
--build-arg VCS_REF="$(VCS_REF)" \
--build-arg VERSION="$(VERSION)" \
--build-arg VCS_BRANCH="$(VCS_BRANCH)" \
--build-arg VCS_DESCRIBED="$(VCS_DESCRIBED)" \
--build-arg HOSTNAME="$(HOSTNAME)" \
-t $(IMAGE_NAME):$(VERSION) .
docker push $(IMAGE_NAME):$(VERSION)
customized: customized-vscode customized-jupyterlab
customized-vscode: base
docker build \
-f Dockerfile.customized \
--target vscode \
--build-arg IMAGE_NAME="$(IMAGE_NAME)" \
--build-arg BUILD_DATE="$(BUILD_DATE)" \
--build-arg VCS_REF="$(VCS_REF)" \
--build-arg VERSION="$(VERSION)" \
--build-arg VCS_BRANCH="$(VCS_BRANCH)" \
--build-arg VCS_DESCRIBED="$(VCS_DESCRIBED)" \
--build-arg HOSTNAME="$(HOSTNAME)" \
-t $(IMAGE_NAME):customized-vscode-$(VERSION) .
docker push $(IMAGE_NAME):customized-vscode-$(VERSION)
customized-jupyterlab: base
docker build \
-f Dockerfile.customized \
--target jupyterlab \
--build-arg IMAGE_NAME="$(IMAGE_NAME)" \
--build-arg BUILD_DATE="$(BUILD_DATE)" \
--build-arg VCS_REF="$(VCS_REF)" \
--build-arg VERSION="$(VERSION)" \
--build-arg VCS_BRANCH="$(VCS_BRANCH)" \
--build-arg VCS_DESCRIBED="$(VCS_DESCRIBED)" \
--build-arg HOSTNAME="$(HOSTNAME)" \
-t $(IMAGE_NAME):customized-jupyterlab-$(VERSION) .
docker push $(IMAGE_NAME):customized-jupyterlab-$(VERSION)