| 1 |
This directory contains Dockerfiles to create new Docker images for |
| 2 |
running Checker Framework tests reproducibly. |
| 3 |
|
| 4 |
The rest of this file explains how to build new Docker images: |
| 5 |
|
| 6 |
|
| 7 |
Preliminaries: |
| 8 |
|
| 9 |
# Finish docker setup if necessary. |
| 10 |
sudo usermod -aG docker $(whoami) |
| 11 |
# Then log out and back in. |
| 12 |
|
| 13 |
# Obtain Docker credentials. |
| 14 |
# (This is only necessary once per machine; credentials are cached.) |
| 15 |
docker login |
| 16 |
|
| 17 |
|
| 18 |
Create the Docker image: |
| 19 |
|
| 20 |
# Alias to create the Docker image, in an empty directory, and upload to Docker Hub. |
| 21 |
# Takes about 12 minutes for jdk8 or jdk11, about 1 hour for jdk8-plus or jdk11-plus. |
| 22 |
alias create_upload_docker_image=' \ |
| 23 |
rm -rf dockerdir && \ |
| 24 |
mkdir -p dockerdir && \ |
| 25 |
(cd dockerdir && \ |
| 26 |
\cp -pf ../Dockerfile-$OS-$JDKVER Dockerfile && \ |
| 27 |
docker build -t mdernst/$PROJECT-$OS-$JDKVER . && \ |
| 28 |
docker push mdernst/$PROJECT-$OS-$JDKVER) && \ |
| 29 |
rm -rf dockerdir' |
| 30 |
|
| 31 |
export OS=ubuntu |
| 32 |
export JDKVER=jdk8 |
| 33 |
export PROJECT=cf |
| 34 |
create_upload_docker_image |
| 35 |
|
| 36 |
export OS=ubuntu |
| 37 |
export JDKVER=jdk8-plus |
| 38 |
export PROJECT=cf |
| 39 |
create_upload_docker_image |
| 40 |
|
| 41 |
export OS=ubuntu |
| 42 |
export JDKVER=jdk11 |
| 43 |
export PROJECT=cf |
| 44 |
create_upload_docker_image |
| 45 |
|
| 46 |
export OS=ubuntu |
| 47 |
export JDKVER=jdk11-plus |
| 48 |
export PROJECT=cf |
| 49 |
create_upload_docker_image |
| 50 |
|
| 51 |
export OS=ubuntu |
| 52 |
export JDKVER=jdk11-plus-buildjdk |
| 53 |
export PROJECT=cf |
| 54 |
create_upload_docker_image |
| 55 |
|
| 56 |
|
| 57 |
Cleanup: |
| 58 |
|
| 59 |
After creating docker images, consider deleting the docker containers, |
| 60 |
which can take up a lot of disk space. |
| 61 |
To stop and remove/delete all docker containers: |
| 62 |
docker stop $(docker ps -a -q) |
| 63 |
docker rm $(docker ps -a -q) |
| 64 |
or you can just remove some of them. |