Menu
Coddy logo textTech

Distro Detective

Part of the Introduction to Docker section of Coddy's Terminal journey — lesson 38 of 40.

challenge icon

Challenge

Medium

Compare two operating systems. Run these commands one after the other:

  1. In an alpine container, print the PRETTY_NAME line of /etc/os-release
  2. In an ubuntu container, print its PRETTY_NAME line

Use sh -c with grep PRETTY_NAME /etc/os-release inside each container, and --rm so the containers clean themselves up.

Use -w /etc to set the working directory, then sh -c "grep PRETTY_NAME os-release" inside each container, with --rm so the containers clean themselves up.

Try it yourself

Terminal

All lessons in Introduction to Docker