Files
mm/docs/BUILDING_DOCKER.md
T
Anghelo Carvajal a0c992ea35 Fix docker builds (#1814)
* Fix dockerfile.

It was broken because the practicerom package changed stuff and apt didn't like whatever changed.
This is the commit that seems to have broken how the old practicerom package worked: https://github.com/glankk/n64/commit/e7bec93b0b11b37a63abcf5ac28728f2fcd4045b#diff-b335630551682c19a781afebcf4d07bf978fb1f8ac04c6bf87428ed5106870f5

* Update docker docs.

Some references were broken in the markdown files, and there's no longer a need to run the git `safe.directory` command since the docker file was doing it already

* Include `gcc-mips-linux-gnu` in the dockerfile

* break up dockerfile commands a bit more

* Update practicerom instructions

* Update practice rom again
2025-08-12 17:02:58 -07:00

42 lines
2.0 KiB
Markdown

# Building using Docker
## Dependencies
You will need [Docker](https://docs.docker.com/get-docker/) Follow the instructions for your operating system.
## 1. Clone the Repository
You will need to prepare a local version of the project with a copied base ROM (see steps [2. Clone the repository](../README.md#2-clone-the-repository) and [3. Prepare a base ROM](../README.md#3-prepare-a-base-rom) of the Linux instructions).
## 2. Create the Docker image
From inside your local project, run the following command:
```bash
docker build . -t mm
```
This will build a docker image with the name of `mm`, to verify the image was made you can run the command
```bash
docker image ls
```
and look for `mm` under the "REPOSITORY" column.
## 3. Start the container
To start the container, you can mount your local filesystem into the Docker container and run an interactive bash session.
```bash
docker run -it --rm --mount type=bind,source="$(pwd)",destination=/mm mm "/usr/bin/env bash"
```
- The `-it` flags Keep STDIN open even if not attached to the container and allocates a pseudo-tty terminal.
- The `--rm` flags causes Docker to automatically remove the container when it exits.
- The `--mount` flag allows you to mount volumes and host-directories in a container. By specifying the type to be a bind, we are saying there are files to be mounted from the host machine (the one that runs your docker daemon) onto the container. Source is specifying where we are mounting the files from in this case, we want the `mm` folder created earlier. The $(pwd) sub-command expands to the current working directory. The destination takes as its value the path where the file or directory is mounted in the container. This makes it so that the image should rarely change and will reduce the need to rebuild with any change to the codebase.
## 4. Setup and Build the ROM
After that continue with step [4. Make and Build the ROM](../README.md#4-make-and-build-the-rom) of the Linux instructions to setup and build the ROM, or run any other command you need.