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

$VIRTUAL_HOST #203

Closed
gajeevan opened this issue Jul 25, 2015 · 4 comments
Closed

$VIRTUAL_HOST #203

gajeevan opened this issue Jul 25, 2015 · 4 comments

Comments

@gajeevan
Copy link

Creating and running a container behind nginx-proxy reverse proxy works perfect. docker run -e VIRTUAL_HOST=example.com.....

Is there any way to add to the $VIRTUAL_HOST variable on a running container? export VIRTUAL_HOST=example.com,example1.com.....work within in the container but does not hold after rebooting the container?

Is there any other way to tackle this issue with having to:
commit -> save -> load -> and then do a new docker run

Thanks in advance for any help!

@thaJeztah
Copy link
Contributor

First, the save/load step should not be required (docker commit already commits your containers to a new image).

Currently, environment variables (and labels) in docker are immutable; you can change an environment variable inside the container, but "on the outside", the value doesn't change (docker inspect <my-container> will still show the value that was set when creating the container).

I don't think there's anything nginx-proxy can do about that, unless docker will support making changes on a running container (which is still being discussed, but not sure if that will be supported).

In general, a container should be stateless and should not contain changes. Any changes in a container you want to persist, should be stored in a volume, so that you are able to remove / upgrade / replace a container without loosing anything.

@gajeevan
Copy link
Author

The problem with my docker commit command is that when I was cleaning up my container folder I accident might have erased a folder that was dependant. The container works just fine, the server can be rebooted.

[root@CA3JMCSDOCKER01 ~]# docker commit 777c52344bb7

FATA[0005] Error response from daemon: Driver devicemapper failed to create image rootfs 09d761bf1049e61f8fcfb2057eeff20d26a91c0ff72977a86e495f03517a9f85: Unknown device 3bf975ba7b0ecb6561a2c0a8f0c6995745c815feb600597a5d8a7e47b082892d

I am not sure what to make of it. How do I go about creating a volume in docker? Is there a specific docker hub volume container that you recommend.....or

Do I use a specific folder on the desktop and then share it as a volume use the "-v" express when starting a container?

@thaJeztah
Copy link
Contributor

I think this page covers all about volumes; https://docs.docker.com/userguide/dockervolumes/

@tkw1536
Copy link
Collaborator

tkw1536 commented Apr 10, 2022

Resolved by previous comment. Please open a a discussion if you still have questions.

@tkw1536 tkw1536 closed this as completed Apr 10, 2022
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