Skip to content

Commit 71e499d

Browse files
authored
Merge pull request #64 from wheremyfoodat/docker
2 parents 8f12be5 + 899e83c commit 71e499d

File tree

2 files changed

+40
-1
lines changed

2 files changed

+40
-1
lines changed

Dockerfile

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# Build image with docker build --tag fe6 .
2+
# Create a container with docker run -it fe6
3+
# Start the container on subsequent runs with docker start
4+
# Inside the container, you can run ./setup.sh, which clones the repo and builds agbcc + tools for you
5+
FROM ubuntu:24.04
6+
SHELL ["/bin/bash", "-c"]
7+
CMD ["/bin/bash"]
8+
9+
RUN apt update && apt dist-upgrade -y
10+
11+
# Install sudo just so sudo commands don't fail in the container
12+
RUN apt install -y sudo git make pkg-config
13+
RUN apt install -y build-essential gcc-arm-none-eabi binutils-arm-none-eabi libpng-dev python3-full python3-pip python-is-python3
14+
15+
# Create python venv, activate it and install packages
16+
RUN python -m venv /fe6_venv && \
17+
source /fe6_venv/bin/activate && \
18+
pip install requests argparse numpy pillow
19+
20+
# Add our venv to path, so that it's automatically used
21+
ENV VIRTUAL_ENV=/fe6_venv
22+
ENV PATH="/fe6_venv/bin:$PATH"
23+
24+
# Add a setup.sh to the container that clones the repo and builds agbcc+tools
25+
RUN echo "git clone https://github.com/FireEmblemUniverse/fireemblem6j && cd fireemblem6j && ./tools/install_agbcc.sh && ./build_tools.sh" >> setup.sh && \
26+
chmod 777 setup.sh

README.md

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ GBAFE decompilation progress history can be found on [laqieer's FE decomp portal
1616
- get a copy of the original rom (still required for every build for now), put it in this folder and name it `fe6-base.gba`.
1717

1818
```bash
19-
# install dependence
19+
# install dependencies
2020
sudo apt update
2121
sudo apt install -y build-essential gcc-arm-none-eabi binutils-arm-none-eabi libpng-dev
2222
python -m pip install requests argparse numpy pillow
@@ -29,6 +29,19 @@ make compare
2929

3030
In the future, a native GCC or GCC-like C compiler (such as clang) will be required to build tools, there is just no tool to build yet.
3131

32+
## Building with Docker
33+
34+
If you're on Windows, MacOS, or a Linux distribution without the necessary packages, you can build the project using [Docker](https://www.docker.com/get-started/), which will create a small Virtual Machine (VM) with all the tools you need.
35+
36+
- Download [Docker Desktop](https://docs.docker.com/get-started/get-docker/) and open it.
37+
- Download our Dockerfile. Open a terminal and navigate to the Dockerfile's location.
38+
- `docker build --tag fe6_image .` to build our Docker image.
39+
- `docker run -it --name fe6_container fe6_image` to create a VM and boot into its shell.
40+
41+
The VM will have all dependencies preinstalled, and a `setup.sh` script which you can run to automatically clone the repo and build agbcc+tools. All you have to do is copy your ROM to the repo's root and run `make compare` to build the project. To copy files between the VM and host, use the [`docker cp` command](https://docs.docker.com/reference/cli/docker/container/cp/#examples)
42+
43+
On subsequent runs, you can start the VM again with `docker start -ai fe6_container`. Many IDEs and text editors, such as Visual Studio Code and CLion, have Docker integration and can connect to your VM for easy development.
44+
3245
## Contributing
3346

3447
Please do. I'm going to be pretty strict on what I accept though, so mind your formatting and naming conventions.

0 commit comments

Comments
 (0)