docker search nginx
docker pull nginx:lates
docker run --name mynginx -p 8080:80 -d nginx:latest
docker ps
docker exec -it mynginx /bin/bash
whereis nginx
cd /etc/nginx
ls
cat nginx.conf
nginx.conf 파일 확인
user nginx;
worker_processes auto;
error_log /var/log/nginx/error.log notice;
pid /var/run/nginx.pid;
events {
worker_connections 1024;
}
http {
include /etc/nginx/mime.types;
default_type application/octet-stream;
log_format main '$remote_addr - $remote_user [$time_local] "$request" '
'$status $body_bytes_sent "$http_referer" '
'"$http_user_agent" "$http_x_forwarded_for"';
access_log /var/log/nginx/access.log main;
sendfile on;
#tcp_nopush on;
keepalive_timeout 65;
#gzip on;
include /etc/nginx/conf.d/*.conf;
}
cd /mnt/d/Workspace
mkdir docker-examples
cd docker-examples
vim nginx.conf
복사한 내용을 기반으로 server_tokens off; 추가
저장하기
vim Dockerfile
docker build -t nginx:v1 .
docker images
docker run --name mynginx -p 8080:80 -d nginx:v1
docker ps
감사합니다 도움이 많이 되었어요