IniziaInizia gratis

Be safe, don't use root

Not giving access to the root user in your images makes images more foolproof, as users only have access to what's relevant to the use case you intended for the image. Additionally, it is one of the best options to increase their security. We've built an image for you from the following Dockerfile, which tries to install python3 as soon as you start it.

FROM ubuntu
RUN useradd -m repl
USER repl
CMD apt-get install python3

Let's see what happens if we try to install python3 at startup as the repl user.

Questo esercizio fa parte del corso

Introduction to Docker

Visualizza il corso

Istruzioni dell'esercizio

  • Use docker to run the repl_try_install image.

Esercizio pratico interattivo

Passa dalla teoria alla pratica con uno dei nostri esercizi interattivi

Inizia esercizio