Reconfigure Separate Postgres after docker load of image


#1

I ran ‘docker save <image_tar_file> image_id’ on one host and proceeded to run ‘docker load -i <tar_file>’ on a new host. Unlike the old host, I don’t have a /var/discourse/container/.yml file for the loaded image on the new host, so I’m not sure how to go about changing the DISCOURSE_DB_HOST/PASSWORD information for the separate postgres server it will be connecting to. Can someone add some guidance on how I would go about doing this?


(Rafael dos Santos Silva) #2

Did you try setting the environment variables with -e ?


(Matt Palmer) #3

Th easiest solution is just to copy the container definition YAML file around. You can also just push the built image to an image server and pull it down on the other machine; no need for save/load.


#4

Will that work even if the new server doesn’t have outside internet
connectivity?


(Matt Palmer) #5

Sure, you don’t have to host a docker image server on the public Internet.


#6

I had not thought of the -e option. I will research it. I’m fairly new to docker. I just realized that moving the yaml file around won’t work because any modifications that I make will require a rebuild of the app, which makes multiple calls to the outside internet, which I don’t have access to. Also, my current build is not on the same network as the server I’m currently trying to build, so I won’t have a shared image server in order to push and pull the image.


#7

I tried running ‘docker run -e DISCOURSE_DB_USERNAME=username image-id’ but it came back with error:

Already up-to-date.
I, [2017-02-15T18:35:39.055602 #13] INFO -- : Loading --stdin
/pups/lib/pups/config.rb:23:in initialize': undefined method[]' for nil:NilClass (NoMethodError)
 from /pups/lib/pups/cli.rb:27:in new'
 from /pups/lib/pups/cli.rb:27:inrun'
 from /pups/bin/pups:8:in `'

(KANIKA GANDHI) #8

@nishai Did you find the answer why were you getting this last error? I m having the same error.