-
命令小結(jié)(1)
查看全部 -
上課前可以將本節(jié)課的所有代碼先clone下來。
git clone https://github.com/cy101/ghost_config.git
查看全部 -
nginx? 配置
worker_processes 4;
events {worker_connections 1024;}
http {
??? server {
??????? listen 80;
??????? location / {
??????????? proxy_pass http://ghost-app:2368;
??????? }
??? }
}查看全部 -
config.js 文件復(fù)制
var path = require('path'),
config;
config = {
??? production: {
?? ??? ?url: 'http://mytestblog.com',
?? ??? ??? ?mail: {},
?? ??? ??? ?database: {
?? ??? ??? ??? ?client: 'mysql',
?? ??? ??? ??? ?connection: {
?? ??? ??? ??? ??? ?host: 'db',
?? ??? ??? ??? ??? ?user: 'ghost',
?? ??? ??? ??? ??? ?database: 'ghost',
?? ??? ??? ??? ??? ?port: '3306',
?? ??? ??? ??? ??? ?charset: 'utf-8'
?? ??? ??? ??? ??? ??? ??? ?},
?? ??? ??? ??? ??? ?debug: false
?? ??? ??? ?},
?? ??? ?paths: {
?? ??? ??? ?contentPath: path.join(process.env.GHOST_CONTENT,'/')
?? ??? ??? ?},
?? ??? ?server: {
?? ??? ??? ?host: '0.0.0.0',
?? ??? ??? ?port: '2368'
?? ??? ?}
?? ?}
};
module.exports =config;查看全部 -
創(chuàng)建Dockerfile文件
查看全部 -
docker?build?-t?xgqfrms/nginx?. docker?run?nginx
-t tag
. 當(dāng)前目錄
docker run -d -p 80:80 xgqfrms/nginx
curl http://localhost
查看全部 -
ENTRYPOINT ["usr/sbin/nginx", "-g", "daemon off;"] EXPOSE 80
查看全部 -
linux sed
替換 ?
RUN sed -i 's/archive.ubuntu.com/mirrors.ustc.edu.cn/g' /etc/apt/sources.list RUN apt-get update
查看全部 -
FROM?ubuntu MAINTAINER?admin@xyqfrms.xyz RUN?sed?-i?'s/archive.ubuntu.com/mirrors.ustc.edu.cn/g'?/etc/apt/sources.list RUN?apt-get?update RUN?apt-get?install?-y?nginx COPY?index.html?/var/www/html ENTRYPOINT?["usr/sbin/nginx",?"-g",?"daemon?off;"] EXPOSE?80
查看全部 -
構(gòu)建 image
docker?build?-t?ImagesName?.
. path
查看全部 -
Dockerfile
FROM?alpine:?latest MAINTAINER?xbf CMD?echo?'hello?docker'
查看全部 -
docker ps -a
docker rm ids
clear?
===
command + L
查看全部 -
docker rmi id
remove image
查看全部 -
保存
docker commit? -m "message" container id new-container-name
查看全部
舉報(bào)