diff --git a/README.md b/README.md index 86130eb..8f03574 100644 --- a/README.md +++ b/README.md @@ -10,7 +10,7 @@ working across different projects via [VisualMode](https://www.visualmode.dev/). For a steady stream of TILs, [sign up for my newsletter](https://visualmode.kit.com/newsletter). -_1747 TILs and counting..._ +_1748 TILs and counting..._ See some of the other learning resources I work on: @@ -246,6 +246,7 @@ If you've learned something here, support my efforts writing daily TILs by - [Reload The nginx Configuration](devops/reload-the-nginx-configuration.md) - [Resolve The Public IP Of A URL](devops/resolve-the-public-ip-of-a-url.md) - [Running Out Of inode Space](devops/running-out-of-inode-space.md) +- [Set, Get, And Unset Env Vars With Dokku](devops/set-get-and-unset-env-vars-with-dokku.md) - [Set Up Domain For Hatchbox Rails App](devops/set-up-domain-for-hatchbox-rails-app.md) - [SSH Into A Docker Container](devops/ssh-into-a-docker-container.md) - [SSL Certificates Can Cover Multiple Domains](devops/ssl-certificates-can-cover-multiple-domains.md) diff --git a/devops/set-get-and-unset-env-vars-with-dokku.md b/devops/set-get-and-unset-env-vars-with-dokku.md new file mode 100644 index 0000000..6567357 --- /dev/null +++ b/devops/set-get-and-unset-env-vars-with-dokku.md @@ -0,0 +1,29 @@ +# Set, Get, And Unset Env Vars With Dokku + +The `dokku` CLI provides `config` subcommands for managing environment variables +for the target container. + +An env var can be set for an active container with `config:set`: + +```bash +$ dokku config:set app-name JEMALLOC_ENABLED=true MALLOC_CONF="stats_print:true" +``` + +Notice I'm able to set multiple env vars at once if needed. + +If I ever need to check what an env var is currently set to for one of my app +containers, I can use `config:get`: + +```bash +$ dokku config:get app-name JEMALLOC_ENABLED +true +``` + +I can always override any value with another `config:set`. However, if I need to +entirely remove the env var, I can use `config:unset`: + +```bash +$ dokku config:unset app-name MALLOC_CONF +``` + +[source](https://dokku.com/docs/configuration/environment-variables/)