Problems with Docker and truenas scale

  • Issue type: Config problem
  • OS Version/build: TrueNAS-SCALE-22.02.0.1

Hello, I’m new to docker and I’m having a bit of trouble, I use truenas Scale and I’m trying to set up two containers for FoundryVTT using Docker Hub. The first one works fine since it lissens too port 30000, my problem is setting up the next one. I use the following parameters

FOUNDRY_USERNAME=redacted
FOUNDRY_PASSWORD=redacted
CONTAINER_PRESERVE_CONFIG=True
/mnt/storage/foundrytwo:/data

I also THINK i am setting the publish to port 30001 (Se picture bellow) But i must be doing something wrong, the logs show that the program still lissens to port 30000.

2022-04-29T22:13:47.487330794Z Entrypoint | 2022-04-29 22:13:47 | [[32minfo[0m] Starting felddy/foundryvtt container v9.269.0

2022-04-29T22:13:47.517035536Z Entrypoint | 2022-04-29 22:13:47 | [[32minfo[0m] No Foundry Virtual Tabletop installation detected.

2022-04-29T22:13:47.517934289Z Entrypoint | 2022-04-29 22:13:47 | [[32minfo[0m] Using FOUNDRY_USERNAME and FOUNDRY_PASSWORD to authenticate.

2022-04-29T22:13:47.836136201Z Authenticate | 2022-04-29 22:13:47 | [[32minfo[39m] Requesting CSRF tokens from https://foundryvtt.com

2022-04-29T22:13:48.631819153Z Authenticate | 2022-04-29 22:13:48 | [[32minfo[39m] Logging in as: redacted

2022-04-29T22:13:50.003295212Z Authenticate | 2022-04-29 22:13:50 | [[32minfo[39m] Successfully logged in as: redacted

2022-04-29T22:13:50.011568699Z Entrypoint | 2022-04-29 22:13:50 | [[32minfo[0m] Using authenticated credentials to download release.

2022-04-29T22:13:50.190181108Z ReleaseURL | 2022-04-29 22:13:50 | [[32minfo[39m] Fetching S3 pre-signed release URL for build 269…

2022-04-29T22:13:50.967494983Z Entrypoint | 2022-04-29 22:13:50 | [[32minfo[0m] Using CONTAINER_CACHE: /data/container_cache

2022-04-29T22:13:50.969352218Z Entrypoint | 2022-04-29 22:13:50 | [[32minfo[0m] Downloading Foundry Virtual Tabletop release.

2022-04-29T22:13:50.976061878Z % Total % Received % Xferd Average Speed Time Time Time Current

2022-04-29T22:13:50.976083757Z Dload Upload Total Spent Left Speed

2022-04-29T22:13:50.976098459Z

2022-04-29T22:13:51.518165721Z 0 0 0 0 0 0 0 0 --:–:-- --:–:-- --:–:-- 0

2022-04-29T22:13:51.708152887Z 0 0 0 0 0 0 0 0 --:–:-- --:–:-- --:–:-- 0

2022-04-29T22:13:51.708225975Z 0 0 0 0 0 0 0 0 --:–:-- --:–:-- --:–:-- 0

2022-04-29T22:13:51.713945078Z Entrypoint | 2022-04-29 22:13:51 | [[32minfo[0m] Installing Foundry Virtual Tabletop 9.269

2022-04-29T22:13:54.008911969Z Entrypoint | 2022-04-29 22:13:54 | [[32minfo[0m] Preserving release archive file in cache.

2022-04-29T22:13:54.070168551Z Entrypoint | 2022-04-29 22:13:54 | [[32minfo[0m] Not modifying existing installation license key.

2022-04-29T22:13:54.070730139Z Entrypoint | 2022-04-29 22:13:54 | [[32minfo[0m] Setting data directory permissions.

2022-04-29T22:13:54.083634338Z Entrypoint | 2022-04-29 22:13:54 | [[32minfo[0m] Starting launcher with uid:gid as foundry:foundry.

2022-04-29T22:13:54.088127055Z Launcher | 2022-04-29 22:13:54 | [[32minfo[0m] Generating options.json file.

2022-04-29T22:13:54.218725368Z Launcher | 2022-04-29 22:13:54 | [[33mwarn[0m] No ‘Admin Access Key’ has been configured.

2022-04-29T22:13:54.227310824Z Launcher | 2022-04-29 22:13:54 | [[32minfo[0m] Starting Foundry Virtual Tabletop.

2022-04-29T22:13:55.039656590Z FoundryVTT | 2022-04-29 22:13:55 | [[32minfo[39m] Running on Node.js - Version 16.14.2

2022-04-29T22:13:55.050995762Z FoundryVTT | 2022-04-29 22:13:55 | [[32minfo[39m] Foundry Virtual Tabletop - Version 9 Build 269

2022-04-29T22:13:55.051339320Z FoundryVTT | 2022-04-29 22:13:55 | [[32minfo[39m] Loading data from user directory - /data

2022-04-29T22:13:55.051720045Z FoundryVTT | 2022-04-29 22:13:55 | [[32minfo[39m] Application Options:

2022-04-29T22:13:55.051741357Z {

2022-04-29T22:13:55.051747334Z “port”: 30000,

2022-04-29T22:13:55.051751845Z “upnp”: false,

2022-04-29T22:13:55.051755985Z “fullscreen”: false,

2022-04-29T22:13:55.051760317Z “hostname”: null,

2022-04-29T22:13:55.051764392Z “localHostname”: null,

2022-04-29T22:13:55.051771603Z “routePrefix”: null,

2022-04-29T22:13:55.051775956Z “sslCert”: null,

2022-04-29T22:13:55.051779986Z “sslKey”: null,

2022-04-29T22:13:55.051784027Z “awsConfig”: null,

2022-04-29T22:13:55.051788000Z “dataPath”: “/data”,

2022-04-29T22:13:55.051794902Z “passwordSalt”: null,

2022-04-29T22:13:55.051799412Z “proxySSL”: false,

2022-04-29T22:13:55.051803512Z “proxyPort”: null,

2022-04-29T22:13:55.051807534Z “serviceConfig”: null,

2022-04-29T22:13:55.051811582Z “updateChannel”: “release”,

2022-04-29T22:13:55.051815715Z “language”: “en.core”,

2022-04-29T22:13:55.051822976Z “upnpLeaseDuration”: null,

2022-04-29T22:13:55.051827422Z “compressStatic”: true,

2022-04-29T22:13:55.051831537Z “world”: null,

2022-04-29T22:13:55.051835683Z “isElectron”: false,

2022-04-29T22:13:55.051839775Z “isNode”: true,

2022-04-29T22:13:55.051846678Z “isSSL”: false,

2022-04-29T22:13:55.051851023Z “noupdate”: true,

2022-04-29T22:13:55.051855108Z “noIPDiscovery”: false,

2022-04-29T22:13:55.051859233Z “demo”: null

2022-04-29T22:13:55.051863339Z }

2022-04-29T22:13:55.054319753Z FoundryVTT | 2022-04-29 22:13:55 | [[31merror[39m] Software license verification failed. Please confirm your Foundry Virtual Tabletop software license

2022-04-29T22:13:55.065889209Z FoundryVTT | 2022-04-29 22:13:55 | [[32minfo[39m] Server started and listening on port 30000

regardless if you create one or more containers from the same image, the container port will always be the same, unless the image provides an environment variable that allows to change the port (which then of course will require the container port to be mapped that you specified in the environment variable) or you mount a configuration file into the container that uses a changed port.

  • If the container uses --network=host the container port needs to be changed to prevent a port collision, as each container shares the hosts network interface - in this case no port publishing (which seem to translate to forwarding in truenas scale) is necessary/possible.
  • If the container uses a bridge or overlay network, the ports inside each container can not cause a port collision, as each container has it’s own network interface. Ports need to be published from the container to the host in order to access the container port. Always use the container port as given in the Dockerhub description, unless you understand why and how to change it.

Hello, i managed to solve it with the information that they always lissen to port 30000. I just had to set the node port to 30000 on the first image and node port 30001 on the secound one and it started working.

I’m new to docker and i assumed that the container port on two different containers could not be the same, but this is not the case!