Last updated
Last updated
In this lesson, you will learn how to use the USER instruction to create a non-privileged user. Rather than using root, we can use a non-privileged user to configure and run an application.
Step 1: Setup your environment:
Step 2: Create the Dockerfile:
Step 3: Creates a CentOS image that uses cloud_user as a non-privileged user
Dockerfile contents:
Step 4: Build the new image:
Step 5: Create a container using the new image:
Step 6: Connecting as a privileged user:
Step 1: Set up the environment:
Step 2: Clone the Github Repository
Step 3: Create the Dockerfile:
Step 4: Create an image for the weather-app
Dockerfile contents:
Step 5: Build the weather-app image using the non-privileged user node_user:
Step 6: Create a container using the nishanthkp/weather-app-nonroot:v1 image: