Docker sq
Docker Fundamentals - Container Lifecycle

Becoming PID1

Mute
Current Time 0:00
/
Duration Time 0:00
Loaded: 0%
Progress: 0%
Stream TypeLIVE
Remaining Time -0:00
 
PRO

Becoming PID1

To solve the issue from the previous video, you can use the exec form for your image's CMD instruction instead of the shell form. This will not wrap the process in a shell.

This form uses a JSON-style array containing the command to exeute, followed by the command-line arguments. It may look like this:

CMD ["/usr/sbin/nginx", "-g", "daemon off;"]
 

I finished! On to the next chapter