Docker創(chuàng)建openresty容器的實(shí)現(xiàn)步驟
1.拉取最新images
docker pull openresty/openresty:latest
2.創(chuàng)建簡單容器
docker run -itd --restart=unless-stopped \ --name openresty \ -p 80:80 \ openresty/openresty:latest
3.創(chuàng)建成功后將重要配置文件從容器中復(fù)制出來,方便后續(xù)掛載。/data/docker/openresty文件夾自己創(chuàng)建好
docker cp bcbca2ce1641:/etc/nginx/conf.d /data/docker/openresty/conf.d docker cp bcbca2ce1641:/usr/local/openresty/nginx/conf /data/docker/openresty/nginx.conf docker cp bcbca2ce1641:/usr/local/openresty/nginx/logs /data/docker/openresty/logs docker cp bcbca2ce1641:/usr/local/openresty/nginx/html /data/docker/openresty/html
4.銷毀剛才創(chuàng)建的簡單容器
docker ps docker stop 容器id docker rm 容器id
5.創(chuàng)建復(fù)雜容器**個(gè)人建議把創(chuàng)建命令編輯成.sh的腳本文件
docker run -itd --restart=unless-stopped \ --name openresty \ -p 80:80 \ -v /data/docker/openresty/conf.d:/etc/nginx/conf.d \ -v /data/docker/openresty/nginx.conf:/usr/local/openresty/nginx/conf/ \ -v /data/docker/openresty/logs:/usr/local/openresty/nginx/logs \ -v /data/docker/openresty/html:/usr/local/openresty/nginx/html \ -v /data/docker/openresty/cert:/usr/local/openresty/nginx/cert \ -v /data/docker/openresty/run:/var/run/openresty \ -v /data/docker/openresty/nginx/lua:/usr/local/openresty/nginx/lua \ openresty/openresty:latest
到此這篇關(guān)于Docker創(chuàng)建openresty容器的實(shí)現(xiàn)步驟的文章就介紹到這了,更多相關(guān)Docker創(chuàng)建openresty容器內(nèi)容請搜索腳本之家以前的文章或繼續(xù)瀏覽下面的相關(guān)文章希望大家以后多多支持腳本之家!
相關(guān)文章
dockerfile的使用及使用dockerfile部署springboot項(xiàng)目的過程
Dockerfile是用來構(gòu)建Docker鏡像的文本文件,是由一條條構(gòu)建鏡像所需的指令和參數(shù)構(gòu)成的腳本,這篇文章主要介紹了dockerfile的使用,使用dockerfile部署springboot項(xiàng)目,需要的朋友可以參考下2023-04-04Docker搭建Skywalking的實(shí)現(xiàn)示例
本文主要介紹了Docker搭建Skywalking的實(shí)現(xiàn)示例,文中通過示例代碼介紹的非常詳細(xì),對大家的學(xué)習(xí)或者工作具有一定的參考學(xué)習(xí)價(jià)值,需要的朋友們下面隨著小編來一起學(xué)習(xí)學(xué)習(xí)吧2025-02-02docker 命令報(bào)異常permission denied的解決方案
這篇文章主要介紹了docker 命令報(bào)異常permission denied的解決方案,具有很好的參考價(jià)值,希望對大家有所幫助。一起跟隨小編過來看看吧2021-03-03詳解Docker 配置國內(nèi)免費(fèi)registry mirror
本篇文章主要介紹了 Docker 配置國內(nèi)免費(fèi)registry mirror,具有一定的參考價(jià)值,有興趣的小伙伴們可以參考一下2017-07-07docker部署高斯數(shù)據(jù)庫的詳細(xì)步驟
文章詳細(xì)介紹了如何在Docker中部署高斯數(shù)據(jù)庫(openGauss),包括安裝Docker、拉取鏡像、運(yùn)行容器、設(shè)置環(huán)境變量和掛載數(shù)據(jù)卷等步驟,還提供了連接和配置遠(yuǎn)程連接的指導(dǎo),感興趣的朋友一起看看吧2024-12-12Docker 使用nsenter工具進(jìn)入容器的操作
這篇文章主要介紹了Docker 使用nsenter工具進(jìn)入容器的操作,具有很好的參考價(jià)值,希望對大家有所幫助。一起跟隨小編過來看看吧2020-11-11docke-cli的調(diào)試環(huán)境搭建過程
在搭建docker-cli的調(diào)試環(huán)境時(shí),遇到很多坑,通過本文講解下搭建docke-cli的調(diào)試環(huán)境的詳細(xì)方法,需要的朋友可以參考下2022-11-11