Skip to content

Commit

Permalink
Update docker instructions to mount the docker socket
Browse files Browse the repository at this point in the history
This is because apache/brooklyn-dist#118 now build docker, therefore the container needs to be able to access the docker engine on the host
  • Loading branch information
tbouron committed Nov 4, 2018
1 parent a915db7 commit e09ef2b
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion README.md
Expand Up @@ -25,7 +25,7 @@ get this project and its sub-modules:

And then, with jdk 1.8+ and maven 3.1+ installed:

mvn clean install -Dno-go-client -Dno-rpm -Dno-deb
mvn clean install -Dno-go-client -Dno-rpm -Dno-deb -DskipDocker

However, you won't be able to build the RPM/DEB packages, as well as the CLI. That's why we would recommand to use the
alternative: a docker container to build this project:
Expand All @@ -34,13 +34,15 @@ alternative: a docker container to build this project:
docker build -t brooklyn .
docker run -i --rm --name brooklyn -u $(id -u):$(id -g) \
--mount type=bind,source="${HOME}/.m2/settings.xml",target=/var/maven/.m2/settings.xml,readonly \
-v /var/run/docker.sock:/var/run/docker.sock \
-v ${PWD}:/usr/build -w /usr/build \
brooklyn mvn clean install -Duser.home=/var/maven -Duser.name=$(id -un)
```

You can speed this up by using your local .m2 cache:
```bash
docker run -i --rm --name brooklyn -u $(id -u):$(id -g) \
-v /var/run/docker.sock:/var/run/docker.sock \
-v ${HOME}/.m2:/var/maven/.m2 \
-v ${PWD}:/usr/build -w /usr/build \
brooklyn mvn clean install -Duser.home=/var/maven -Duser.name=$(id -un)
Expand Down

0 comments on commit e09ef2b

Please sign in to comment.