sotn-decomp/Dockerfile
Mark Street f573a99ec1
Add bsdmainutils to requirements (#1667)
- `column` util was missing from the Docker image, added it and
organised the requirements file so it's more human friendly
- rearranged the USER argument in the Dockerfile to avoid the scenario
where you didnt specify the user and so lose the layers where apt
installed all the packages
- add the python deps at the end to ensure docker can reuse cached
layers if a python dep changes.
- update maspsx (I wanted to test latest maspsx against sotn, so this is
what led to the other changes!)
2024-09-24 16:54:32 -07:00

27 lines
948 B
Docker

# build container and tag it as sotn-build:latest
# docker build --tag sotn-build:latest --build-arg USER=$USER .
# launch container and mount current directory under /sotn
# docker run --rm -it -v $(pwd):/sotn sotn-build /bin/bash
# make extract -j && make build -j
FROM ubuntu:22.04
ADD /tools/requirements-debian.txt /tools/requirements-debian.txt
RUN apt-get update && apt-get install -y $(cat /tools/requirements-debian.txt)
WORKDIR /sotn
ARG USER
RUN adduser ${USER}
ENV VENV_PATH=/tools/.venv
RUN mkdir -p ${VENV_PATH}
RUN chown ${USER} /sotn ${VENV_PATH}
USER ${USER}
# this is similar to `make python-dependencies`, however,
# the Makefile is not available until a container has
# been created.
ADD tools/requirements-python.txt /tools/requirements-python.txt
RUN python3 -m venv ${VENV_PATH} && \
. ${VENV_PATH}/bin/activate && \
pip install -r /tools/requirements-python.txt
RUN git config --global --add safe.directory /sotn