The project consists of two parts:
- Compile and run
nginx
inside a vagrant machine and then create a repo of rpm packages based onnginx
- Create custom
nginx
docker image and push it into the Docker Cloud
vagrant
should be installed on your system
$ vagrant -v
Vagrant 2.2.5
- Clone this repository
$ git clone https://github.com/ligain/rpm.git
- Go to project folder
$ cd rpm/
- Run vagrant
$ vagrant up
docker
should be installed on your system
$ docker --version
Docker version 17.05.0-ce, build 89658be
- Clone this repository
$ git clone https://github.com/ligain/rpm.git
- Go to project folder
$ cd rpm/
- Build an image
$ docker build . -t custom-nginx:1.14.1
- Run container
$ docker run --name cust-nginx -p 8080:80 -d custom-nginx:1.14.1
- Test
nginx
welcome page on the host machine
$ curl localhost:8080
<!DOCTYPE html>
<html>
<head>
<title>Welcome to nginx!</title>
<style>
body {
width: 35em;
margin: 0 auto;
font-family: Tahoma, Verdana, Arial, sans-serif;
}
</style>
</head>
<body>
<h1>Welcome to nginx!</h1>
<p>If you see this page, the nginx web server is successfully installed and
working. Further configuration is required.</p>
<p>For online documentation and support please refer to
<a href="http://nginx.org/">nginx.org</a>.<br/>
Commercial support is available at
<a href="http://nginx.com/">nginx.com</a>.</p>
<p><em>Thank you for using nginx.</em></p>
</body>
</html>
- Also you can pull this image from Docker Cloud
$ docker pull linder/custom-nginx
The code is written for educational purposes.