forked from typetools/checker-framework
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Dockerfile-README
69 lines (52 loc) · 1.64 KB
/
Dockerfile-README
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
62
63
64
65
66
67
68
69
This directory contains Dockerfiles to create new Docker images for
running Checker Framework tests reproducibly.
The rest of this file explains how to build new Docker images:
Preliminaries:
# Finish docker setup if necessary.
sudo usermod -aG docker $(whoami)
# Then log out and back in.
# Obtain Docker credentials.
# (This is only necessary once per machine; credentials are cached.)
docker login
Create the Docker image:
# Alias to create the Docker image, in an empty directory, and upload to Docker Hub.
# Takes about 12 minutes for jdk8 or jdk11, about 1 hour for jdk8-plus or jdk11-plus.
alias create_upload_docker_image=' \
rm -rf dockerdir && \
mkdir -p dockerdir && \
(cd dockerdir && \
\cp -pf ../Dockerfile-$OS-$JDKVER Dockerfile && \
docker build -t mdernst/$PROJECT-$OS-$JDKVER . && \
docker push mdernst/$PROJECT-$OS-$JDKVER) && \
rm -rf dockerdir'
export OS=ubuntu
export JDKVER=jdk8
export PROJECT=cf
create_upload_docker_image
export OS=ubuntu
export JDKVER=jdk8-plus
export PROJECT=cf
create_upload_docker_image
export OS=ubuntu
export JDKVER=jdk11
export PROJECT=cf
create_upload_docker_image
export OS=ubuntu
export JDKVER=jdk11-plus
export PROJECT=cf
create_upload_docker_image
export OS=ubuntu
export JDKVER=jdk17
export PROJECT=cf
create_upload_docker_image
export OS=ubuntu
export JDKVER=jdk17-plus
export PROJECT=cf
create_upload_docker_image
Cleanup:
After creating docker images, consider deleting the docker containers,
which can take up a lot of disk space.
To stop and remove/delete all docker containers:
docker stop $(docker ps -a -q)
docker rm $(docker ps -a -q)
or you can just remove some of them.