Skip to content
Exercise · Your first container · lesson 7 of 7

Exercise: run nginx

Now put everything from this theme into one command: start the nginx web server so that its page opens on your computer.

commands.txt holds a draft: docker run nginx. Complete it so that the file keeps one docker run command, which:

  • starts the container in the background;
  • names the container web;
  • publishes a port so that port 8080 on the host leads to port 80 in the container;
  • uses the image nginx:1.27.3.

Nobody runs the command: the check reads its text. The tests tab shows which checks run.

commands.txt — shell
shell · 2 lines
Ctrl+Enter run · Esc leave editor