# docker-build **Repository Path**: beentan/docker-build ## Basic Information - **Project Name**: docker-build - **Description**: docker build file - **Primary Language**: Unknown - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2016-10-14 - **Last Updated**: 2020-12-19 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README ###docker build: shell> docker-build shell> cd lnmp shell >docker build -t centos7:lnmp . shell >docker run -i -t --name lnmp1 -p 90:80 -v /etc/localtime:/etc/localtime:ro -v /opt/docker_file/conf.d:/etc/nginx/conf.d:ro -v /opt/docker_file/www:/etc/nginx/html centos7:lnmp & ※注意 1、-v 后面:ro为只读,如需要容器中能修改,则改为:rw(默认为rw) 2、如需要在容器中的/etc/hosts中添加hosts解析,在docker run时需要添加 --add-host www.test.com:127.0.0.1(如果加多个域名同时指到127.0.0.1,就需要再添加一个--add-host,目前还未找到更好的添加方法……) jdk的容器ssh出现: bash: warning: setlocale: LC_ALL: cannot change locale (en_US.UTF-8) /bin/sh: warning: setlocale: LC_ALL: cannot change locale (en_US.UTF-8) 在容器中执行:localedef -v -c -i en_US -f UTF-8 en_US.UTF-8