support older versions of docker and docker-compose (#414)

This commit is contained in:
Paul Robertson 2021-09-09 11:13:45 -04:00 committed by GitHub
parent 765d2bb23d
commit d6154359d9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 24 additions and 7 deletions

View File

@ -304,16 +304,19 @@ The files in this volume should be owned by the factorio user, uid 845.
[Docker Compose](https://docs.docker.com/compose/install/) is an easy way to run Docker containers. [Docker Compose](https://docs.docker.com/compose/install/) is an easy way to run Docker containers.
First get a [docker-compose.yml](https://github.com/factoriotools/factorio-docker/blob/master/0.17/docker-compose.yml) file. To get it from this repository: * docker-engine >= 1.10.0 is required
* docker-compose >=1.6.0 is required
First get a [docker-compose.yml](https://github.com/factoriotools/factorio-docker/blob/master/docker/docker-compose.yml) file. To get it from this repository:
```shell ```shell
git clone https://github.com/factoriotools/factorio-docker.git git clone https://github.com/factoriotools/factorio-docker.git
cd docker_factorio_server/0.17 cd factorio-docker/docker
``` ```
Or make your own: Or make your own:
```shell ```yaml
version: '2' version: '2'
services: services:
factorio: factorio:
@ -342,7 +345,7 @@ sudo docker-compose up -d
Ensure the `lan` setting in server-settings.json is `true`. Ensure the `lan` setting in server-settings.json is `true`.
```shell ```json
"visibility": "visibility":
{ {
"public": false, "public": false,

View File

@ -13,8 +13,8 @@ ARG SHA256
ENV PORT=34197 \ ENV PORT=34197 \
RCON_PORT=27015 \ RCON_PORT=27015 \
VERSION=${VERSION:?} \ VERSION=${VERSION} \
SHA256=${SHA256:?} \ SHA256=${SHA256} \
SAVES=/factorio/saves \ SAVES=/factorio/saves \
CONFIG=/factorio/config \ CONFIG=/factorio/config \
MODS=/factorio/mods \ MODS=/factorio/mods \
@ -25,6 +25,14 @@ ENV PORT=34197 \
SHELL ["/bin/ash", "-eo", "pipefail", "-c"] SHELL ["/bin/ash", "-eo", "pipefail", "-c"]
RUN set -ox pipefail \ RUN set -ox pipefail \
&& if [[ "${VERSION}" == "" ]]; then \
echo "build-arg VERSION is required" \
&& exit 1; \
fi \
&& if [[ "${SHA256}" == "" ]]; then \
echo "build-arg SHA256 is required" \
&& exit 1; \
fi \
&& archive="/tmp/factorio_headless_x64_$VERSION.tar.xz" \ && archive="/tmp/factorio_headless_x64_$VERSION.tar.xz" \
&& mkdir -p /opt /factorio \ && mkdir -p /opt /factorio \
&& apk add --update --no-cache --no-progress bash binutils curl file gettext jq libintl pwgen shadow su-exec \ && apk add --update --no-cache --no-progress bash binutils curl file gettext jq libintl pwgen shadow su-exec \

View File

@ -1,7 +1,13 @@
version: '2' version: '2'
services: services:
factorio: factorio:
build: . build:
context: .
args:
# Check buildinfo.json for supported versions and SHAs
# https://github.com/factoriotools/factorio-docker/blob/master/buildinfo.json
- VERSION=1.1.39
- SHA256=5528b8e23ac5d3a13e3328a0c64fee71f4a321792afe7b2fe46f95e62b7ed119
ports: ports:
- "34197:34197/udp" - "34197:34197/udp"
- "27015:27015/tcp" - "27015:27015/tcp"