dockerfile example
This commit is contained in:
@@ -40,6 +40,24 @@ Le direttive più comuni utilizzate in un Dockerfile includono:
|
||||
- `ENTRYPOINT`: definisce l'eseguibile predefinito all'avvio del container. Se non viene specificato, l'eseguibile predefinito è tipicamente `/bin/sh`
|
||||
- `CMD`: specifica i parametri di avvio per l'ENTRYPOINT
|
||||
|
||||
```dockerfile
|
||||
# Pull base image
|
||||
FROM debian:latest
|
||||
|
||||
# Dockerfile Maintainer
|
||||
MAINTAINER dado "dado@mail.me"
|
||||
|
||||
# Install nginx and adjust nginx config to stay in foreground
|
||||
RUN apt-get update && apt-get install --no-install-recommends -y nginx; \
|
||||
echo "daemon off;" >> /etc/nginx/nginx.conf
|
||||
|
||||
# Expose HTTP
|
||||
EXPOSE 80
|
||||
|
||||
# Start nginx
|
||||
CMD ["/usr/sbin/nginx"]
|
||||
```
|
||||
|
||||
## Buid di una immagine Docker
|
||||
|
||||
Per costruire un'immagine Docker, è necessario utilizzare il seguente comando:
|
||||
|
Reference in New Issue
Block a user