48/53
Sign inSign up free

846. Mount Configuration Read-Only With Compose configs

medium 20 XP ~8 minHands-on lab

Labs have no container engine, so nothing is started: your files are checked with docker-compose config.

The web service of image-resizer gets its nginx configuration from two writable bind mounts. A compromised container could rewrite the host's files, and after someone edited site.conf with an editor that saves to a new file, nginx kept serving the old version.

Task

In /home/student/projects/image-resizer/compose.yaml:

  • declare two top-level configs: nginx_conf from the file ./nginx/nginx.conf and site_conf from ./nginx/site.conf,
  • give them to web at the same paths as before (/etc/nginx/nginx.conf and /etc/nginx/conf.d/default.conf), with mode 0444,
  • web has no volumes left. Keep its image and port.

About this machine

Ubuntu 24.04 with no internet access. You are student with passwordless sudo. The grader checks the final state of the machine, not the commands you typed. Values like names and ports are generated for you.

Teaching or writing about this? Embed this lab on your page

TerminalNot started

Your machine is ready to start

A fresh, isolated Ubuntu machine boots in a few seconds with the task already set up.

No account needed: 3 of 3 free tries left. Guest machines last 30 minutes.