Skip to content

Commit

Permalink
Add documentation for docker builds (#128)
Browse files Browse the repository at this point in the history
  • Loading branch information
mguidon authored May 13, 2022
1 parent a145751 commit c35d337
Show file tree
Hide file tree
Showing 2 changed files with 84 additions and 0 deletions.
83 changes: 83 additions & 0 deletions Build/CompilingInDocker.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
## Docker builds

Docker builds are managed from the `Makefile` in the root folder. Typing `make` will print out some helpful information.

### Prerequisites

Required:

- `docker`
- `docker-compose`
- `Makefile`

Recommende:

- `vs code`

### Build Image

`iSEG` can be build entirely using a docker build image based on ubuntu 18.04. The build image is published on [Dockerhub](https://hub.docker.com/repository/docker/itisfoundation/iseg-ubuntu-buildkit).
The build image contains all required 3rd party dependencies and compilers to build `iSEG`.
If required, the build image can be rebuild using the `Dockerfile` in the `docker` subfolder.

To create a new one:

```
make create-build-image
```

To publish it to the `Dockerhub`:

```
make publish-build-image.
```

Make sure to increase the version for every new build image.

### Compiling

Compilation is done by mounting the source folder into the build container and executing a build script. Compiled binaries are kept in a docker-volume to avoid recompilation after every build invocation.

To compile in release:

```
make build-release
```

To compile in debug:

```
make build-debug
```

To clean the build folders (i.e. removing the build volume)

```
make clean-build
```

### Debugging

Visual Studio Codes remote container debugging can be used as follows:

```
make debug-in-container
```

This creates a `devcontainer` settings and starts a new vs code instance using the build-image. By default, the `iSeg` debug target is active. New ones can be added by editing a `launch.json` file.

### Run

`iSeg` can be started via

```
make run-release
```

or

```
make run-debug
```

as well as from the debug container. This is achieved by mounting the `X11` socket and the `DISPLAY` variable into the build containers.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,3 +40,4 @@ For installing EIGEN just download and extract the [source code](http://eigen.tu
- Windows/Visual Studio [instructions](Build/CompilingWindows.md)
- MacOS/Clang++ [instructions](Build/CompilingMacOS.md)
- Ubuntu [github action](.github/workflows/build.yml)
- With Docker images [instructions](Build/CompilingInDocker.md)

0 comments on commit c35d337

Please sign in to comment.