Building to Configuring and Integrating a NGINX Web Server on Docker Hub"
installing docker by trypng (docker install and enter) either on ubuntu or debian,and follow the instructions outlined.
Go to dockerhub and create an account to be able to download image.
On your interface,click on explore and search for ‘nginx’
Copy and paste any version of your choice e.g docker pull nginx:alpine-slim and when its done downloading,type docker image to see the image is successfully created.
create a website by typing on your browser, ’free css template’ copy the link and paste on mobaxterm
Using the command; wget and then paste your link.
To unzip the file use this command:sudo apt install unzip -y
Then you unzip: unzip (name of the template).zip
BUILD IMAGE
create a file: nano Dockerfile and click enter.
To move the docker image inside the file: “ cp Dockerfile (name of your template)/
Then “ ls -la “ to bring it out,
To build a new image
‘docker build -t (name of template) .
-
To run the container: ‘ docker run -d -p 8080:80 (name of template)
Use docker ps to check if its running.
Then check if its running on your browser
INTEGRATING TO DOCKER HUB REPOSITORY
CREATE A REPOSITORY
go to account setting and click on personal token to generate (read and write)
-
docker tag (name of template):latest (username)/ (name of template)
docker login -u (username)
password will be asked—copy the token generated and paste and click enter.
docker push (username/name of template).
- And now it has successfully integrated to the repository created.
If everything is set up correctly, you should see your "It works!" message. If you encounter any further issues, feel free to let me know!