Craftsman at Work

I'm Artur Karbone, coding software architect and independent IT consultant and this is my blog about craftsmanship, architecture, distributed systems, management and much more.

Linux: Persist Environment Variables

When you introduce a new environment variable in bash:

export DOCKER_HOST=localhost:2375

It will disappear after you restart your terminal, reconnect via ssh, whatever.

In order not to miss the variable or your setting of choice later on, just append the appropriate command to the .bash_profile file:

echo "export DOCKER_HOST=localhost:2375" >> ~/.bash_profile

echo "alias docker='sudo docker'" > .bash_profile

comments powered by Disqus