• Home
  • History
  • Annotate
Name Date Size #Lines LOC

..03-May-2022-

000-default.confH A D17-Sep-2021129 65

Container_Registry.mdH A D17-Sep-2021797 75

DockerfileH A D17-Sep-20211.3 KiB3628

README.mdH A D17-Sep-20213.8 KiB8147

benchmark.shH A D17-Sep-2021524 2712

upload-tagged-docker.shH A D17-Sep-2021682 2521

README.md

1# Docker instructions
2Navigate to the 'docker' folder that contains the Dockerfile and run the following command to build the image with palisade-development repository latest commit:
3
4**Building docker image:**
5
6```docker build -t <imagename> . ```
7
8example:
9```docker build -t palisade-development . ```
10
11no_threads is an argument (with a default value of 1 if it is not passed as an argument) for running make with the -j flag while installing palisade in the docker build. A different value for the number of threads can be passed as an argument to the docker build with the following command:
12
13```docker build -t palisade-development . --build-arg no_threads=4```
14
15CC_param and CXX_param are used to set the compiler for C++, the default compiler is g++-10 if the arguments are not set.
16
17example:
18```docker build -t palisade-development . --build-arg no_threads=1 --build-arg CC_param=/usr/bin/clang-10 --build-arg=/usr/bin/clang++-10```
19
20The palisade repository and the release tag are also arguments that can be passed to the docker build to build the corresponding image (the default repository is palisade-development, master branch and the latest commit).
21
22For example, to build palisade-release v1.10.6, run the following command:
23```docker build -t palisade-release . --build-arg repository=palisade-release --build-arg tag=tags/v1.10.6```
24
25The docker build also works for compiling specific commits of a specific branch of a repository:
26```docker build -t palisade-release . --build-arg repository=palisade-release --build-arg branch=<branch_name> --build-arg tag=<commit_hash>```
27
28Note: To checkout a specific release/tag, pass the argument as "tags/<tag_id>" and not just the <tag_id>.
29
30
31Summary of the arguments to docker build:
32
33- repository: refers to the repository to be built.
34- branch: specific branch of the repository.
35- tag: either the release tag (example tags/v1.10.6-dev) or specific commit hash.
36- CC_param: only passed as argument if the compiler is clang-10.
37- CXX_param: only passed as argument if the compiler is clang++-10.
38- no_threads: argument to run make with as many threads.
39
40**Running docker container with the docker image:**
41
42Once the image is built, run the container by using:
43
44```docker run -it --name palisade <imagename>```
45
46example:
47```docker run -it --name palisade palisade-development```
48
49- the -it flag is used to run the container in interactive mode with a bash shell
50- --name flag creates the docker container with name as palisade.
51- -p can be used to expose the port of the container to the host machine, example: ```docker run -it -p 80:80 --name palisade palisade-development```
52
53**Running additional examples with docker palisade installation:**
54
55The palisade installation in the docker container can be used for running palisade examples by mounting the examples repository into the container with the -v flag. The following command runs a docker container and mounts the palisade-serial-examples folder into the docker container:
56
57```docker run -it -v ${PWD}/palisade-serial-examples:/palisade-serial-examples palisade```
58
59Multiple terminals of the same container (that may be needed for client/server examples) can be run using
60
61```docker exec -it palisade /bin/bash```
62
63**Clean up:**
64
65Type 'exit' to leave the container shell.
66
67To clean all containers once palisade-development is done running
68
69```docker kill palisade```
70
71```docker container prune```
72
73To remove all the docker images and containers in the system, run ```docker system prune```
74
75**Instructions for registry**:
76
77To build and push docker build to the registry, run the upload-tagged-docker.sh as
78```./upload-tagged-docker.sh -r <repository> -j <no_threads> -t <tag_id>```
79
80Follow instructions in [Container_Registry.md](https://gitlab.com/palisade/palisade-development/-/blob/master/docker/Container_Registry.md) to run docker container with an image from the registry.
81