diff --git a/Dockerfile b/Dockerfile index 5d0b51cbd5..131ed20f1b 100644 --- a/Dockerfile +++ b/Dockerfile @@ -25,5 +25,4 @@ RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone & WORKDIR /oot RUN git config --global --add safe.directory /oot -CMD ["/bin/sh", "-c", \ - "echo 'usage:\n docker run --rm --mount type=bind,source=\"$(pwd)\",destination=/oot oot make -j$(nproc) setup\n docker run --rm --mount type=bind,source=\"$(pwd)\",destination=/oot oot make -j$(nproc)'"] +CMD make -j $(nproc) setup && make -j $(nproc) && tail -f /dev/null diff --git a/docker-compose.yml b/docker-compose.yml index 50a32876c9..bca75f474c 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,10 +1,8 @@ services: oot: + build: + dockerfile: Dockerfile volumes: - - oot-sync:/oot:nocopy - image: "oot:latest" + - ./:/oot tty: true - -volumes: - oot-sync: - external: true + stdin_open: true diff --git a/docs/BUILDING_DOCKER.md b/docs/BUILDING_DOCKER.md index afc35b48bc..98aed29c97 100644 --- a/docs/BUILDING_DOCKER.md +++ b/docs/BUILDING_DOCKER.md @@ -6,22 +6,20 @@ To use Docker, you'll need either Docker Desktop or Docker Toolbox installed and You'll also need to prepare a local version of the project with a copied base ROM (see steps [2](../README.md#2-clone-the-repository) and [3](../README.md#3-prepare-a-base-rom) of the Linux instructions). -## 2. Create the Docker image +## 2. Create and start the Docker image build -From inside your local project, run the following command: +From the root of your local project, run the following command: ```bash -docker build . -t oot +docker-compose up --build ``` -## 3. Start the container +This should immediately begin steps [4](../README.md#4-setup-the-rom-and-build-process) and [5](../README.md#5-build-the-rom) within the Docker container. -To start the container, you can mount your local filesystem into the Docker container and run an interactive bash session. +## 3. Shell into the 'oot' container + +To exec into the oot Docker image at any time, run the following command either during or after the build: ```bash -docker run -it --rm --mount type=bind,source="$(pwd)",destination=/oot oot /bin/bash +docker-compose exec oot bash ``` - -## 4. Setup and Build the ROM - -Once inside the container, you can follow steps [4](../README.md#4-setup-the-rom-and-build-process) and [5](../README.md#5-build-the-rom) of the Linux instructions to setup and build the ROM, or run any other command you need.