docker search mysql
docker pull mysql:5.6
# 在/root目錄下建立mysql目錄用於存儲mysql數據信息 mkdir ~/mysql cd ~/mysql
docker run -id \ -p 3306:3306 \ --name=c_mysql \ -v $PWD/conf:/etc/mysql/conf.d \ -v $PWD/logs:/logs \ -v $PWD/data:/var/lib/mysql \ -e MYSQL_ROOT_PASSWORD=123456 \ mysql:5.6
/root/mysql
。docker exec –it c_mysql /bin/bash
docker search tomcat
docker pull tomcat
# 在/root目錄下建立tomcat目錄用於存儲tomcat數據信息 mkdir ~/tomcat cd ~/tomcat
docker run -id --name=c_tomcat \ -p 8080:8080 \ -v $PWD:/usr/local/tomcat/webapps \ tomcat
docker search nginx
docker pull nginx
# 在/root目錄下建立nginx目錄用於存儲nginx數據信息 mkdir ~/nginx cd ~/nginx mkdir conf cd conf # 在~/nginx/conf/下建立nginx.conf文件,粘貼下面內容(nginx官網默認的配置文件) vim nginx.conf
user nginx; worker_processes 1; error_log /var/log/nginx/error.log warn; 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; }
docker run -id --name=c_nginx \ -p 80:80 \ -v $PWD/conf/nginx.conf:/etc/nginx/nginx.conf \ -v $PWD/logs:/var/log/nginx \ -v $PWD/html:/usr/share/nginx/html \ nginx
docker search redis
docker pull redis:5.0
docker run -id --name=c_redis -p 6379:6379 redis:5.0
# 安裝python3版本的 docker pull continuumio/anaconda3
docker run -it --name=anaconda -p 8888:8888 continuumio/anaconda3
參數說明:html
jupyter notebook --ip=0.0.0.0 --allow-root
參數說明:python