Skip to content

Commit

Permalink
✨ Issue #5904 [Docker ] Add an argument for the CARLA repository
Browse files Browse the repository at this point in the history
  • Loading branch information
Seb Mascha committed Nov 2, 2022
1 parent bcf3471 commit fec0eca
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 13 deletions.
4 changes: 2 additions & 2 deletions Docs/build_docker_unreal.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,10 +66,10 @@ The following command will use the image created in the previous step to build t
docker build -t carla -f Carla.Dockerfile .
```

If you would like to build a specific branch or tag of the CARLA repository, run the following command:
If you would like to build a specific CARLA repository (defaulted to https://github.com/carla-simulator/carla.git), a branch or tag (defaulted to master), run the following command:

```sh
docker build -t carla -f Carla.Dockerfile . --build-arg GIT_BRANCH=<branch_or_tag_name>
docker build -t carla -f Carla.Dockerfile . --build-arg GIT_BRANCH=<branch_or_tag_name> --build-arg GIT_REPO=<repo_url>
```

---
Expand Down
18 changes: 9 additions & 9 deletions Util/Docker/Carla.Dockerfile
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
FROM carla-prerequisites:latest

ARG GIT_BRANCH
ARG GIT_BRANCH=master
ARG GIT_REPO=https://github.com/carla-simulator/carla.git

USER carla
WORKDIR /home/carla
USER ue4
WORKDIR /home/ue4

RUN cd /home/carla/ && \
if [ -z ${GIT_BRANCH+x} ]; then git clone --depth 1 https://github.com/carla-simulator/carla.git; \
else git clone --depth 1 --branch $GIT_BRANCH https://github.com/carla-simulator/carla.git; fi && \
cd /home/carla/carla && \
RUN cd /home/ue4 && \
git clone --depth 1 --branch $GIT_BRANCH "$GIT_REPO" && \
cd /home/ue4/carla && \
./Update.sh && \
make CarlaUE4Editor && \
make PythonAPI && \
make build.utils && \
make package && \
rm -r /home/carla/carla/Dist
rm -r /home/ue4/carla/Dist

WORKDIR /home/carla/carla
WORKDIR /home/ue4/carla
4 changes: 2 additions & 2 deletions Util/Docker/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,10 +72,10 @@ docker build -t carla -f Carla.Dockerfile .

## Other useful information

You can use a specific repository **branch** or **tag** from our repository, using:
You can use a specific **repository** and a **branch** or **tag** from our repository, using:

```
docker build -t carla -f Carla.Dockerfile . --build-arg GIT_BRANCH=branch_name
docker build -t carla -f Carla.Dockerfile . --build-arg GIT_BRANCH=branch_name --build-arg GIT_REPO=https://github.com/carla-simulator/carla.git
```

Clean up the intermediate images from the build (keep the ue4-source image so you can use it for full rebuilds)
Expand Down

0 comments on commit fec0eca

Please sign in to comment.