sre*_*ary 6 nginx docker dockerfile docker-compose nginx-reverse-proxy
我正在尝试将角度应用程序容器化。这是我的泊坞窗文件
FROM nginx
LABEL author="sreeya"
COPY ./config/nginx.conf /etc/nginx/ngnix.cong
Run Code Online (Sandbox Code Playgroud)
我用了
docker build -t nginx-angular -f nginx.dockerfile .
docker run -p 8080:80 -v $(pwd)/dist:/usr/share/nginx/html nginx-angular
Run Code Online (Sandbox Code Playgroud)
构建成功,但 docker run 陷入困境
start worker process 30
Run Code Online (Sandbox Code Playgroud)
这是完整的输出
/docker-entrypoint.sh: /docker-entrypoint.d/ is not empty, will attempt to perform configuration
/docker-entrypoint.sh: Looking for shell scripts in /docker-entrypoint.d/
/docker-entrypoint.sh: Launching /docker-entrypoint.d/10-listen-on-ipv6-by-default.sh
10-listen-on-ipv6-by-default.sh: info: Getting the checksum of /etc/nginx/conf.d/default.conf
10-listen-on-ipv6-by-default.sh: info: Enabled listen on IPv6 in /etc/nginx/conf.d/default.conf
/docker-entrypoint.sh: Launching /docker-entrypoint.d/20-envsubst-on-templates.sh
/docker-entrypoint.sh: Launching /docker-entrypoint.d/30-tune-worker-processes.sh
/docker-entrypoint.sh: Configuration complete; ready for start up
2021/12/28 16:14:03 [notice] 1#1: using the "epoll" event method
2021/12/28 16:14:03 [notice] 1#1: nginx/1.21.4
2021/12/28 16:14:03 [notice] 1#1: built by gcc 10.2.1 20210110 (Debian 10.2.1-6)
2021/12/28 16:14:03 [notice] 1#1: OS: Linux 4.19.130-boot2docker
2021/12/28 16:14:03 [notice] 1#1: getrlimit(RLIMIT_NOFILE): 1048576:1048576
2021/12/28 16:14:03 [notice] 1#1: start worker processes
2021/12/28 16:14:03 [notice] 1#1: start worker process 30
Run Code Online (Sandbox Code Playgroud)
请帮我解决
小智 2
容器已启动并正在运行,它没有卡在那里。容器默认以附加模式运行。您可以使用命令以分离模式运行容器 -
docker run -d -p 8080:80 -v $(pwd)/dist:/usr/share/nginx/html nginx-angular
Run Code Online (Sandbox Code Playgroud)
或者将其保持打开状态并尝试使用命令检查新终端中的容器状态 -
sudo docker ps
Run Code Online (Sandbox Code Playgroud)
归档时间: |
|
查看次数: |
4958 次 |
最近记录: |