Learn Docker With My Newest Course

Dive into Docker takes you from "What is Docker?" to confidently applying Docker to your own projects. It's packed with best practices and examples. Start Learning Docker →

Docker Tip #58: Output All of Your Container's ENV Variables

blog/cards/docker-tips-and-tricks.jpg

This isn't really a Docker tip because you can do the same thing on any Linux based OS but it's useful nonetheless.

Once in a while I find myself wanting to quickly see the values of all environment variables running in a container. This is useful when you configure your apps through ENV variables.

View your container’s environment variables:
docker container run --rm alpine:3.7 env

# The above command produces this output:
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
HOSTNAME=157baf151103
HOME=/root

Easy peasy!

Free Intro to Docker Email Course

Over 5 days you'll get 1 email per day that includes video and text from the premium Dive Into Docker course. By the end of the 5 days you'll have hands on experience using Docker to serve a website.


Comments