This repository contains Dockerfile of Nginx for Docker's automated build published to the public Docker Hub Registry.
-
Install Docker.
-
Install Docker-Compose.
# Linux
curl -L https://github.com/kubernetes/kompose/releases/download/v1.16.0/kompose-linux-amd64 -o kompose
# macOS
curl -L https://github.com/kubernetes/kompose/releases/download/v1.16.0/kompose-darwin-amd64 -o kompose
chmod +x kompose
sudo mv ./kompose /usr/local/bin/kompose
- Download automated build from public Docker Hub Registry:
docker pull dockerfile/nginx
(alternatively, you can build an image from Dockerfile:docker build -t="dockerfile/nginx" github.com/dockerfile/nginx
)
# build the docker image
/bin/docker-compose -f docker-compose.yml build --force-rm --no-cache
# start the container in the background
/bin/docker-compose -f docker-compose.yml up -d
# Alternativly you can use docker command
docker run -d -p 80:80 dockerfile/nginx
# Attach persistent/shared directories
docker run -d -p 80:80 -v <sites-enabled-dir>:/etc/nginx/conf.d -v <html-dir>:/usr/share/nginx/html -v <main-config>:/etc/nginx/nginx.conf dockerfile/nginx
# View your results
After few seconds, open `http://localhost` to see the welcome page.
-
Simplify your development process with Docker-Compose and then deploy your containers to a Kubernetes production cluster
-
Convert your docker-compose.yaml with one simple command:
kompose convert
- Immediately bring up your Kubernetes cluster with:
kompose up
- Bring it back down with:
kompose down