Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Any official docker image released? #53

Closed
changchiyou opened this issue Nov 4, 2024 · 8 comments
Closed

Any official docker image released? #53

changchiyou opened this issue Nov 4, 2024 · 8 comments

Comments

@changchiyou
Copy link

I saw this

* I had some success running it in Docker, using an Ubuntu 20.04 image.

but I can't find any guide for docker user, have I missed something? (#26 seems like a uncomplete task)

@Palats
Copy link
Owner

Palats commented Nov 4, 2024

No, as the README state, that is relatively advanced setup, so you're mostly on your own on that one. I also have no desire to maintain an official image for the time being. Also, note that distributing a docker image would not be allowed to contain Factorio itself, so that would be of limited interest I think.

That being said, if someone is willing to contribute a clean Dockerfile, that might be an option (not sure - it depends what it looks like I guess).

@Palats Palats closed this as completed Nov 4, 2024
@changchiyou
Copy link
Author

It might be a good idea to check the latest version & download regularly with https://wiki.factorio.com/Download_API, instead of containing Factorio itself inside the docker image.

@martydingo
Copy link

I did create one for myself

https://github.com/martydingo/factorio-mapshot-docker

&

https://hub.docker.com/r/martydingo/mapshot

I run it with Kubernetes, however usage should be similar.

@martydingo
Copy link

I run it with two containers in a single deployment, you can achieve this with docker-compose also.

        - image: martydingo/mapshot:latest
          imagePullPolicy: Always
          name: mapshot-renderer
          env:
            - name: FACTORIO_USERNAME
              value: "username"
            - name: FACTORIO_TOKEN
              value: "token"
            - name: FACTORIO_SAVE
              value: "/opt/factorio/saves/rail-age.factorio.dingo.nexus.zip"
            - name: MAPSHOT_AREA
              value: "_all_"
            # - name: MAPSHOT_FACTORIO_BINARY_PATH
            #   value: "/mapshot/factorio/bin/x64/factorio"
            # - name: MAPSHOT_FACTORIO_DATA_DIRECTORY
            #   value: "/mapshot/factorio"
            - name: MAPSHOT_JPEG_QUALITY
              value: "95"
            - name: MAPSHOT_MINIMUM_JPEG_QUALITY
              value: "95"
            # - name: MAPSHOT_MAXIMUM_TILES
            #   value: ""
            - name: MAPSHOT_MINIMUM_TILES
              value: "64"
            - name: MAPSHOT_MODE
              value: "render"
            # - name: MAPSHOT_ROOT_DIRECTORY
            #   value: "/mapshot"
            - name: MAPSHOT_SURFACES_TO_RENDER
              value: "_all_"
            # - name: MAPSHOT_VERBOSE_FACTORIO_LOGGING
            #   value: ""
            - name: MAPSHOT_VERBOSE_MAPSHOT_LOG_LEVEL_INT
              value: "9"
            # - name: MAPSHOT_WORKING_DIRECTORY
            #   value: "/mapshot/factorio"
            - name: MAPSHOT_INTERVAL
              value: "600"
          volumeMounts:
            - mountPath: /opt/factorio
              name: factorio-mapshot-rail-age-factorio-dingo-nexus
              readOnly: true
            - mountPath: /mapshot
              name: mapshot-mapshot-rail-age-factorio-dingo-nexus
        - image: martydingo/mapshot:latest
          imagePullPolicy: Always
          name: mapshot-server
          env:
            # - name: MAPSHOT_FACTORIO_BINARY_PATH
            #   value: "/mapshot/factorio/bin/x64/factorio"
            # - name: MAPSHOT_FACTORIO_DATA_DIRECTORY
            #   value: "/mapshot/factorio"
            - name: MAPSHOT_MODE
              value: "serve"
            # - name: MAPSHOT_ROOT_DIRECTORY
            #   value: "/mapshot"
            - name: MAPSHOT_VERBOSE_MAPSHOT_LOG_LEVEL_INT
              value: "9"
            # - name: MAPSHOT_WORKING_DIRECTORY
            #   value: "/mapshot/factorio"

@changchiyou
Copy link
Author

changchiyou commented Nov 12, 2024

@martydingo It looks fantastic! But there are a few points I’d like to confirm:

  1. Do you plan to write a GitHub Action in the future to detect mapshot release updates and automatically package and publish them on Docker Hub? (Or maybe submit a PR to the mapshot repo for collaboration?)
  2. If I want to update the map every 30 minutes, does your implementation require a manual restart of Kubernetes/Docker Compose to achieve this? btw, I noticed that you have set MAPSHOT_INTERVAL=600, but I can't find MAPSHOT_INTERVAL in https://github.com/martydingo/factorio-mapshot-docker/blob/primary/entrypoint.sh , have I missed something?
  3. It seems to always pull the latest version of the Factorio executable. But if the map version is older, would this cause it to not run properly? (Perhaps it might be necessary to first detect the game version compatible with the map and then fetch the corresponding game files? Any way to detect the version of specific map save?)

@martydingo
Copy link

martydingo commented Nov 12, 2024

@changchiyou

  1. Maybe, it's a good idea, it's just time permitting.

  2. That's right, the interval kills the process. Now that you mention it, i don't think I have the most recent version pushed up to git. That's now fixed up here
    The MAPSHOT_INTERVAL variables is placed after a timeout command and the pod will restart. You may need to configure restart: on-failure.

  3. I run two deployments, one factorio, one with mapshot (which has it's own factorio). Yeah, they need to be kept in step, but they will pull the latest version, something I need to look at but personally I just play on experimental and that keeps everything in step.

Palats added a commit that referenced this issue Nov 14, 2024
I have no immediate plans to provide a Dockerfile, so at least give some
pointer as others have managed to do so.
@martydingo
Copy link

@changchiyou @Palats I've documented this, ironically I never saw that mention.

https://github.com/martydingo/factorio-mapshot-docker

Palats added a commit that referenced this issue Nov 16, 2024
@Palats
Copy link
Owner

Palats commented Nov 16, 2024

@martydingo That is great, thanks! (added a more explicit link to your repo in README here)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants