Starting Discourse on a Specific Docker Network

(Daniel Lynch) #1

I can run docker network connect squadwars web_only and then docker network inspect squadwars and see it connected to my squadwars network.

But if I do:

./launcher start web_only --docker-args="–network squadwars" it doesn’t seem to connect itself to that network! (And yes I destroyed the container first).

I don’t see my options being passed to the docker run command.

(Matt Palmer) #2

Try running /bin/bash -x ./launcher <etc etc>, and trace where the --docker-args (and, subsequently, $user_args) gets set and used.

(Daniel Lynch) #3

root@squadwars:/var/discourse# /bin/bash -x ./launcher start web_only --docker-args="–network squadwars" 2>&1 | grep -C 15 args

  • command=start
  • config=web_only
  • user_args=
  • ‘[’ 3 -gt 0 ‘]’
  • case “${1}” in
  • shift 1
  • ‘[’ 2 -gt 0 ‘]’
  • case “${1}” in
  • shift 1
  • ‘[’ 1 -gt 0 ‘]’
  • case “${1}” in
  • shift 1
  • ‘[’ 0 -gt 0 ‘]’

    ++ cat containers/web_only.yml
  • docker_args=

Not really sure how to interpret this but it doesn’t seem to be parsing the --docker-args option.

PG throws could not resize shared memory segment error
(Daniel Lynch) #4

It looks like I can specify docker args in web_only.yml though, do you know the syntax for that?

Edit: Okay the syntax was really easy, just:

docker_args: “–network squadwars”

Now it’s working fine, thank you. (Still doesn’t work from commandline but I don’t care :))

Edit: Well the squadwars network is working fine, but discourse seems to be broken. I’m going to try to add it onto the host network as well, not sure if that works.

Custom docker network configuration - container to container comms