Skip to content

Instantly share code, notes, and snippets.

Last active Apr 2, 2020
What would you like to do?
docker build -t factorio .
docker run --rm -it --name=factorio --net=host -v /srv/factorio:/var/lib/factorio factorio:latest --help
docker run --rm -it --name=factorio --net=host -v /srv/factorio:/var/lib/factorio factorio:latest --create
docker run --rm -it --name=factorio --net=host -v /srv/factorio:/var/lib/factorio factorio:latest --start-server --server-settings server-settings.json
#This value specifies the way the aplication generates default values for and path.write-data
#When set to true, it will use system directories (Users/Name/AppData/Roaming/Factorio on windows), this is set to true
#for the installer versions of Factorio, as people will usualy install it in program files, and the aplication can't write
#to program files by default (without UAC turned off), similar with osx/linux packages.
#When set to false (default value for zip package), it will use application root directory, this is usable to create self-sustainable
#Factorio directory that can be copied anywhere needed (on usb etc), also for people, who don't like to manipulate saves
#in the windows users directory structure (as me, kovarex).
#Note, that once the values in config are generated, this value has no effects (unless you delete config, or the values)
FROM debian:stretch
RUN apt-get update && apt-get install -y \
curl xz-utils
curl -fsSL$FACTORIO_VERSION/headless/linux64 -o /tmp/factorio-$FACTORIO_VERSION.tar.xz && \
tar -C /opt -xvf /tmp/factorio-$FACTORIO_VERSION.tar.xz && \
mv /opt/factorio /opt/factorio-$FACTORIO_VERSION && ln -s factorio-$FACTORIO_VERSION /opt/factorio && \
rm /tmp/factorio-*.tar.xz
RUN addgroup --system --gid 112 factorio && adduser --system --home /var/lib/factorio --uid=112 --gid=112 factorio
COPY config-path.cfg /opt/factorio-$FACTORIO_VERSION/
COPY config.ini /opt/factorio-$FACTORIO_VERSION/config/
VOLUME /var/lib/factorio
ENV PATH=/opt/factorio-$FACTORIO_VERSION/bin/x64:$PATH
USER factorio
WORKDIR /var/lib/factorio
ENTRYPOINT ["factorio"]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment