In this step, we will proceed to build the container image to deploy to your Lightsail container service. Our container image still uses the nginx image but replaces the index.html file to display the greeting.
mkdir lightsail-workshop-nginx
cd lightsail-workshop-nginx
echo "Welcome to Amazon Lightsail Container workshop" > index.html
echo "FROM nginx:latest" > Dockerfile
echo "COPY ./index.html /usr/share/nginx/html/index.html" >> Dockerfile
4. Build our container image by running the following command.
sudo docker build -t nginx-container .
sudo docker run -p 8080:80 nginx-container &
curl localhost:8080