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

How to load a bashrc config in a container #1861

Closed
karellm opened this issue Sep 11, 2013 · 3 comments
Closed

How to load a bashrc config in a container #1861

karellm opened this issue Sep 11, 2013 · 3 comments

Comments

@karellm
Copy link

karellm commented Sep 11, 2013

Hi,

I just got started playing with Docker and I was wondering what was the best way to get a custom bashrc file loaded every time in a container. Either in every container or per container.

Thanks!

@ghost
Copy link

ghost commented Sep 11, 2013

If #1757 gets merged you'll be able to do something like docker run -i -t -v ~/.bashrc:~/.bashrc ubuntu bash. Until then, just make sure ~/.bashrc exists when the container is started:

$ docker run -d ubuntu bash -c "echo 'export foo=bar' > .bashrc"
29b2ebb155e3
$ docker commit 29b2ebb155e3 mybase
e39a1d44ad80
$ docker run -i -t mybase bash
root@2ad5a06af680:/# echo $foo
bar
root@2ad5a06af680:/#

@fsouza
Copy link
Contributor

fsouza commented Sep 12, 2013

Giving that .bashrc is in the image, you can also use /bin/bash -l

@karellm
Copy link
Author

karellm commented Sep 19, 2013

Thanks a lot. I was confused that the loaded .bashrc was /.bashrc and not /root/.bashrc.

@karellm karellm closed this as completed Sep 19, 2013
trebonian pushed a commit to trebonian/docker that referenced this issue Jun 3, 2021
Funnel peerAdd and peerDelete in a channel
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

2 participants