我建立了一个Docker映像,但出现错误:返回了非零代码:1

如何解决我建立了一个Docker映像,但出现错误:返回了非零代码:1

编辑

Dockerfile校正后的日志(添加-y参数)

C:\Users\jl3.PRT-063\Desktop\Docker>docker build -t ocr-docker-build-starwars .
Sending build context to Docker daemon  3.072kB
Step 1/8 : FROM openclassrooms/build_image
 ---> 7f6c67ae7dae
Step 2/8 : RUN apt-get update && apt-get -y install nginx
 ---> Running in b1d4c4d5fb1c
Ign:1 http://deb.debian.org/debian stretch InRelease
Get:2 http://security.debian.org/debian-security stretch/updates InRelease [53.0 kB]
Get:3 http://deb.debian.org/debian stretch-updates InRelease [93.6 kB]
Get:4 http://deb.debian.org/debian stretch Release [118 kB]
Get:5 http://deb.debian.org/debian stretch Release.gpg [2410 B]
Get:6 http://deb.debian.org/debian stretch-updates/main amd64 Packages [2596 B]
Get:7 http://security.debian.org/debian-security stretch/updates/main amd64 Packages [558 kB]
Get:8 http://deb.debian.org/debian stretch/main amd64 Packages [7080 kB]
Fetched 7907 kB in 3s (2122 kB/s)
Reading package lists...
Reading package lists...
Building dependency tree...
Reading state information...
The following additional packages will be installed:
  fontconfig-config fonts-dejavu-core geoip-database libbsd0 libexpat1
  libfontconfig1 libfreetype6 libgd3 libgeoip1 libicu57 libjbig0
  libjpeg62-turbo libnginx-mod-http-auth-pam libnginx-mod-http-dav-ext
  libnginx-mod-http-echo libnginx-mod-http-geoip
  libnginx-mod-http-image-filter libnginx-mod-http-subs-filter
  libnginx-mod-http-upstream-fair libnginx-mod-http-xslt-filter
  libnginx-mod-mail libnginx-mod-stream libpng16-16 libssl1.1 libtiff5
  libwebp6 libx11-6 libx11-data libxau6 libxcb1 libxdmcp6 libxml2 libxpm4
  libxslt1.1 nginx-common nginx-full sgml-base ucf xml-core
Suggested packages:
  libgd-tools geoip-bin fcgiwrap nginx-doc ssl-cert sgml-base-doc debhelper
The following NEW packages will be installed:
  fontconfig-config fonts-dejavu-core geoip-database libbsd0 libexpat1
  libfontconfig1 libfreetype6 libgd3 libgeoip1 libicu57 libjbig0
  libjpeg62-turbo libnginx-mod-http-auth-pam libnginx-mod-http-dav-ext
  libnginx-mod-http-echo libnginx-mod-http-geoip
  libnginx-mod-http-image-filter libnginx-mod-http-subs-filter
  libnginx-mod-http-upstream-fair libnginx-mod-http-xslt-filter
  libnginx-mod-mail libnginx-mod-stream libpng16-16 libssl1.1 libtiff5
  libwebp6 libx11-6 libx11-data libxau6 libxcb1 libxdmcp6 libxml2 libxpm4
  libxslt1.1 nginx nginx-common nginx-full sgml-base ucf xml-core
0 upgraded,40 newly installed,0 to remove and 13 not upgraded.
Need to get 18.7 MB of archives.
After this operation,59.4 MB of additional disk space will be used.
Get:1 http://deb.debian.org/debian stretch/main amd64 libxau6 amd64 1:1.0.8-1 [20.7 kB]
Get:2 http://security.debian.org/debian-security stretch/updates/main amd64 libjpeg62-turbo amd64 1:1.5.1-2+deb9u1 [134 kB]
Get:3 http://deb.debian.org/debian stretch/main amd64 sgml-base all 1.29 [14.8 kB]
Get:4 http://deb.debian.org/debian stretch/main amd64 libssl1.1 amd64 1.1.0l-1~deb9u1 [1358 kB]
Get:5 http://deb.debian.org/debian stretch/main amd64 libicu57 amd64 57.1-6+deb9u4 [7699 kB]
Get:6 http://security.debian.org/debian-security stretch/updates/main amd64 libx11-data all 2:1.6.4-3+deb9u2 [291 kB]
Get:7 http://security.debian.org/debian-security stretch/updates/main amd64 libx11-6 amd64 2:1.6.4-3+deb9u2 [748 kB]
Get:8 http://deb.debian.org/debian stretch/main amd64 libxml2 amd64 2.9.4+dfsg1-2.2+deb9u2 [920 kB]
Get:9 http://security.debian.org/debian-security stretch/updates/main amd64 nginx-common all 1.10.3-1+deb9u5 [105 kB]
Get:10 http://deb.debian.org/debian stretch/main amd64 ucf all 3.0036 [70.2 kB]
Get:11 http://deb.debian.org/debian stretch/main amd64 fonts-dejavu-core all 2.37-1 [1068 kB]
Get:12 http://security.debian.org/debian-security stretch/updates/main amd64 libnginx-mod-http-auth-pam amd64 1.10.3-1+deb9u5 [86.3 kB]
Get:13 http://security.debian.org/debian-security stretch/updates/main amd64 libnginx-mod-http-dav-ext amd64 1.10.3-1+deb9u5 [88.0 kB]
Get:14 http://security.debian.org/debian-security stretch/updates/main amd64 libnginx-mod-http-echo amd64 1.10.3-1+deb9u5 [97.4 kB]
Get:15 http://security.debian.org/debian-security stretch/updates/main amd64 libnginx-mod-http-geoip amd64 1.10.3-1+deb9u5 [87.5 kB]
Get:16 http://deb.debian.org/debian stretch/main amd64 fontconfig-config all 2.11.0-6.7 [271 kB]
Get:17 http://deb.debian.org/debian stretch/main amd64 geoip-database all 20170512-1 [2112 kB]
Get:18 http://security.debian.org/debian-security stretch/updates/main amd64 libnginx-mod-http-image-filter amd64 1.10.3-1+deb9u5 [90.5 kB]
Get:19 http://security.debian.org/debian-security stretch/updates/main amd64 libnginx-mod-http-subs-filter amd64 1.10.3-1+deb9u5 [89.4 kB]
Get:20 http://security.debian.org/debian-security stretch/updates/main amd64 libnginx-mod-http-upstream-fair amd64 1.10.3-1+deb9u5 [89.5 kB]
Get:21 http://deb.debian.org/debian stretch/main amd64 libbsd0 amd64 0.8.3-1 [83.0 kB]
Get:22 http://security.debian.org/debian-security stretch/updates/main amd64 libnginx-mod-http-xslt-filter amd64 1.10.3-1+deb9u5 [89.4 kB]
Get:23 http://deb.debian.org/debian stretch/main amd64 libexpat1 amd64 2.2.0-2+deb9u3 [83.7 kB]
Get:24 http://security.debian.org/debian-security stretch/updates/main amd64 libnginx-mod-mail amd64 1.10.3-1+deb9u5 [118 kB]
Get:25 http://deb.debian.org/debian stretch/main amd64 libpng16-16 amd64 1.6.28-1+deb9u1 [280 kB]
Get:26 http://security.debian.org/debian-security stretch/updates/main amd64 libnginx-mod-stream amd64 1.10.3-1+deb9u5 [110 kB]
Get:27 http://security.debian.org/debian-security stretch/updates/main amd64 nginx-full amd64 1.10.3-1+deb9u5 [459 kB]
Get:28 http://deb.debian.org/debian stretch/main amd64 libfreetype6 amd64 2.6.3-3.2+deb9u1 [438 kB]
Get:29 http://security.debian.org/debian-security stretch/updates/main amd64 nginx all 1.10.3-1+deb9u5 [82.0 kB]
Get:30 http://deb.debian.org/debian stretch/main amd64 libfontconfig1 amd64 2.11.0-6.7+b1 [331 kB]
Get:31 http://deb.debian.org/debian stretch/main amd64 libjbig0 amd64 2.1-3.1+b2 [31.0 kB]
Get:32 http://deb.debian.org/debian stretch/main amd64 libtiff5 amd64 4.0.8-2+deb9u5 [239 kB]
Get:33 http://deb.debian.org/debian stretch/main amd64 libwebp6 amd64 0.5.2-1 [235 kB]
Get:34 http://deb.debian.org/debian stretch/main amd64 libxdmcp6 amd64 1:1.1.2-3 [26.3 kB]
Get:35 http://deb.debian.org/debian stretch/main amd64 libxcb1 amd64 1.12-1 [133 kB]
Get:36 http://deb.debian.org/debian stretch/main amd64 libxpm4 amd64 1:3.5.12-1 [49.1 kB]
Get:37 http://deb.debian.org/debian stretch/main amd64 libgd3 amd64 2.2.4-2+deb9u5 [132 kB]
Get:38 http://deb.debian.org/debian stretch/main amd64 libgeoip1 amd64 1.6.9-4 [90.5 kB]
Get:39 http://deb.debian.org/debian stretch/main amd64 libxslt1.1 amd64 1.1.29-2.1+deb9u2 [233 kB]
Get:40 http://deb.debian.org/debian stretch/main amd64 xml-core all 0.17 [23.2 kB]
debconf: delaying package configuration,since apt-utils is not installed
Fetched 18.7 MB in 4s (4265 kB/s)
Selecting previously unselected package libxau6:amd64.
(Reading database ... 6499 files and directories currently installed.)
Preparing to unpack .../00-libxau6_1%3a1.0.8-1_amd64.deb ...
Unpacking libxau6:amd64 (1:1.0.8-1) ...
Selecting previously unselected package sgml-base.
Preparing to unpack .../01-sgml-base_1.29_all.deb ...
Unpacking sgml-base (1.29) ...
Selecting previously unselected package libssl1.1:amd64.
Preparing to unpack .../02-libssl1.1_1.1.0l-1~deb9u1_amd64.deb ...
Unpacking libssl1.1:amd64 (1.1.0l-1~deb9u1) ...
Selecting previously unselected package libicu57:amd64.
Preparing to unpack .../03-libicu57_57.1-6+deb9u4_amd64.deb ...
Unpacking libicu57:amd64 (57.1-6+deb9u4) ...
Selecting previously unselected package libxml2:amd64.
Preparing to unpack .../04-libxml2_2.9.4+dfsg1-2.2+deb9u2_amd64.deb ...
Unpacking libxml2:amd64 (2.9.4+dfsg1-2.2+deb9u2) ...
Selecting previously unselected package ucf.
Preparing to unpack .../05-ucf_3.0036_all.deb ...
Moving old data out of the way
Unpacking ucf (3.0036) ...
Selecting previously unselected package fonts-dejavu-core.
Preparing to unpack .../06-fonts-dejavu-core_2.37-1_all.deb ...
Unpacking fonts-dejavu-core (2.37-1) ...
Selecting previously unselected package fontconfig-config.
Preparing to unpack .../07-fontconfig-config_2.11.0-6.7_all.deb ...
Unpacking fontconfig-config (2.11.0-6.7) ...
Selecting previously unselected package geoip-database.
Preparing to unpack .../08-geoip-database_20170512-1_all.deb ...
Unpacking geoip-database (20170512-1) ...
Selecting previously unselected package libbsd0:amd64.
Preparing to unpack .../09-libbsd0_0.8.3-1_amd64.deb ...
Unpacking libbsd0:amd64 (0.8.3-1) ...
Selecting previously unselected package libexpat1:amd64.
Preparing to unpack .../10-libexpat1_2.2.0-2+deb9u3_amd64.deb ...
Unpacking libexpat1:amd64 (2.2.0-2+deb9u3) ...
Selecting previously unselected package libpng16-16:amd64.
Preparing to unpack .../11-libpng16-16_1.6.28-1+deb9u1_amd64.deb ...
Unpacking libpng16-16:amd64 (1.6.28-1+deb9u1) ...
Selecting previously unselected package libfreetype6:amd64.
Preparing to unpack .../12-libfreetype6_2.6.3-3.2+deb9u1_amd64.deb ...
Unpacking libfreetype6:amd64 (2.6.3-3.2+deb9u1) ...
Selecting previously unselected package libfontconfig1:amd64.
Preparing to unpack .../13-libfontconfig1_2.11.0-6.7+b1_amd64.deb ...
Unpacking libfontconfig1:amd64 (2.11.0-6.7+b1) ...
Selecting previously unselected package libjpeg62-turbo:amd64.
Preparing to unpack .../14-libjpeg62-turbo_1%3a1.5.1-2+deb9u1_amd64.deb ...
Unpacking libjpeg62-turbo:amd64 (1:1.5.1-2+deb9u1) ...
Selecting previously unselected package libjbig0:amd64.
Preparing to unpack .../15-libjbig0_2.1-3.1+b2_amd64.deb ...
Unpacking libjbig0:amd64 (2.1-3.1+b2) ...
Selecting previously unselected package libtiff5:amd64.
Preparing to unpack .../16-libtiff5_4.0.8-2+deb9u5_amd64.deb ...
Unpacking libtiff5:amd64 (4.0.8-2+deb9u5) ...
Selecting previously unselected package libwebp6:amd64.
Preparing to unpack .../17-libwebp6_0.5.2-1_amd64.deb ...
Unpacking libwebp6:amd64 (0.5.2-1) ...
Selecting previously unselected package libxdmcp6:amd64.
Preparing to unpack .../18-libxdmcp6_1%3a1.1.2-3_amd64.deb ...
Unpacking libxdmcp6:amd64 (1:1.1.2-3) ...
Selecting previously unselected package libxcb1:amd64.
Preparing to unpack .../19-libxcb1_1.12-1_amd64.deb ...
Unpacking libxcb1:amd64 (1.12-1) ...
Selecting previously unselected package libx11-data.
Preparing to unpack .../20-libx11-data_2%3a1.6.4-3+deb9u2_all.deb ...
Unpacking libx11-data (2:1.6.4-3+deb9u2) ...
Selecting previously unselected package libx11-6:amd64.
Preparing to unpack .../21-libx11-6_2%3a1.6.4-3+deb9u2_amd64.deb ...
Unpacking libx11-6:amd64 (2:1.6.4-3+deb9u2) ...
Selecting previously unselected package libxpm4:amd64.
Preparing to unpack .../22-libxpm4_1%3a3.5.12-1_amd64.deb ...
Unpacking libxpm4:amd64 (1:3.5.12-1) ...
Selecting previously unselected package libgd3:amd64.
Preparing to unpack .../23-libgd3_2.2.4-2+deb9u5_amd64.deb ...
Unpacking libgd3:amd64 (2.2.4-2+deb9u5) ...
Selecting previously unselected package libgeoip1:amd64.
Preparing to unpack .../24-libgeoip1_1.6.9-4_amd64.deb ...
Unpacking libgeoip1:amd64 (1.6.9-4) ...
Selecting previously unselected package nginx-common.
Preparing to unpack .../25-nginx-common_1.10.3-1+deb9u5_all.deb ...
Unpacking nginx-common (1.10.3-1+deb9u5) ...
Selecting previously unselected package libnginx-mod-http-auth-pam.
Preparing to unpack .../26-libnginx-mod-http-auth-pam_1.10.3-1+deb9u5_amd64.deb ...
Unpacking libnginx-mod-http-auth-pam (1.10.3-1+deb9u5) ...
Selecting previously unselected package libnginx-mod-http-dav-ext.
Preparing to unpack .../27-libnginx-mod-http-dav-ext_1.10.3-1+deb9u5_amd64.deb ...
Unpacking libnginx-mod-http-dav-ext (1.10.3-1+deb9u5) ...
Selecting previously unselected package libnginx-mod-http-echo.
Preparing to unpack .../28-libnginx-mod-http-echo_1.10.3-1+deb9u5_amd64.deb ...
Unpacking libnginx-mod-http-echo (1.10.3-1+deb9u5) ...
Selecting previously unselected package libnginx-mod-http-geoip.
Preparing to unpack .../29-libnginx-mod-http-geoip_1.10.3-1+deb9u5_amd64.deb ...
Unpacking libnginx-mod-http-geoip (1.10.3-1+deb9u5) ...
Selecting previously unselected package libnginx-mod-http-image-filter.
Preparing to unpack .../30-libnginx-mod-http-image-filter_1.10.3-1+deb9u5_amd64.deb ...
Unpacking libnginx-mod-http-image-filter (1.10.3-1+deb9u5) ...
Selecting previously unselected package libnginx-mod-http-subs-filter.
Preparing to unpack .../31-libnginx-mod-http-subs-filter_1.10.3-1+deb9u5_amd64.deb ...
Unpacking libnginx-mod-http-subs-filter (1.10.3-1+deb9u5) ...
Selecting previously unselected package libnginx-mod-http-upstream-fair.
Preparing to unpack .../32-libnginx-mod-http-upstream-fair_1.10.3-1+deb9u5_amd64.deb ...
Unpacking libnginx-mod-http-upstream-fair (1.10.3-1+deb9u5) ...
Selecting previously unselected package libxslt1.1:amd64.
Preparing to unpack .../33-libxslt1.1_1.1.29-2.1+deb9u2_amd64.deb ...
Unpacking libxslt1.1:amd64 (1.1.29-2.1+deb9u2) ...
Selecting previously unselected package libnginx-mod-http-xslt-filter.
Preparing to unpack .../34-libnginx-mod-http-xslt-filter_1.10.3-1+deb9u5_amd64.deb ...
Unpacking libnginx-mod-http-xslt-filter (1.10.3-1+deb9u5) ...
Selecting previously unselected package libnginx-mod-mail.
Preparing to unpack .../35-libnginx-mod-mail_1.10.3-1+deb9u5_amd64.deb ...
Unpacking libnginx-mod-mail (1.10.3-1+deb9u5) ...
Selecting previously unselected package libnginx-mod-stream.
Preparing to unpack .../36-libnginx-mod-stream_1.10.3-1+deb9u5_amd64.deb ...
Unpacking libnginx-mod-stream (1.10.3-1+deb9u5) ...
Selecting previously unselected package nginx-full.
Preparing to unpack .../37-nginx-full_1.10.3-1+deb9u5_amd64.deb ...
Unpacking nginx-full (1.10.3-1+deb9u5) ...
Selecting previously unselected package nginx.
Preparing to unpack .../38-nginx_1.10.3-1+deb9u5_all.deb ...
Unpacking nginx (1.10.3-1+deb9u5) ...
Selecting previously unselected package xml-core.
Preparing to unpack .../39-xml-core_0.17_all.deb ...
Unpacking xml-core (0.17) ...
Setting up libexpat1:amd64 (2.2.0-2+deb9u3) ...
Setting up libjpeg62-turbo:amd64 (1:1.5.1-2+deb9u1) ...
Setting up geoip-database (20170512-1) ...
Setting up libpng16-16:amd64 (1.6.28-1+deb9u1) ...
Setting up libjbig0:amd64 (2.1-3.1+b2) ...
Setting up fonts-dejavu-core (2.37-1) ...
Setting up nginx-common (1.10.3-1+deb9u5) ...
debconf: unable to initialize frontend: Dialog
debconf: (TERM is not set,so the dialog frontend is not usable.)
debconf: falling back to frontend: Readline
debconf: unable to initialize frontend: Readline
debconf: (Can't locate Term/ReadLine.pm in @INC (you may need to install the Term::ReadLine module) (@INC contains: /etc/perl /usr/local/lib/x86_64-linux-gnu/perl/5.24.1 /usr/local/share/perl/5.24.1 /usr/lib/x86_64-linux-gnu/perl5/5.24 /usr/share/perl5 /usr/lib/x86_64-linux-gnu/perl/5.24 /usr/share/perl/5.24 /usr/local/lib/site_perl /usr/lib/x86_64-linux-gnu/perl-base .) at /usr/share/perl5/Debconf/FrontEnd/Readline.pm line 7.)
debconf: falling back to frontend: Teletype
Setting up libnginx-mod-http-subs-filter (1.10.3-1+deb9u5) ...
Setting up libtiff5:amd64 (4.0.8-2+deb9u5) ...
Setting up sgml-base (1.29) ...
Setting up libgeoip1:amd64 (1.6.9-4) ...
Setting up libicu57:amd64 (57.1-6+deb9u4) ...
Setting up libbsd0:amd64 (0.8.3-1) ...
Setting up ucf (3.0036) ...
debconf: unable to initialize frontend: Dialog
debconf: (TERM is not set,so the dialog frontend is not usable.)
debconf: falling back to frontend: Readline
debconf: unable to initialize frontend: Readline
debconf: (Can't locate Term/ReadLine.pm in @INC (you may need to install the Term::ReadLine module) (@INC contains: /etc/perl /usr/local/lib/x86_64-linux-gnu/perl/5.24.1 /usr/local/share/perl/5.24.1 /usr/lib/x86_64-linux-gnu/perl5/5.24 /usr/share/perl5 /usr/lib/x86_64-linux-gnu/perl/5.24 /usr/share/perl/5.24 /usr/local/lib/site_perl /usr/lib/x86_64-linux-gnu/perl-base .) at /usr/share/perl5/Debconf/FrontEnd/Readline.pm line 7.)
debconf: falling back to frontend: Teletype
Setting up libxml2:amd64 (2.9.4+dfsg1-2.2+deb9u2) ...
Setting up libfreetype6:amd64 (2.6.3-3.2+deb9u1) ...
Setting up libxslt1.1:amd64 (1.1.29-2.1+deb9u2) ...
Processing triggers for libc-bin (2.24-11+deb9u4) ...
Setting up libssl1.1:amd64 (1.1.0l-1~deb9u1) ...
debconf: unable to initialize frontend: Dialog
debconf: (TERM is not set,so the dialog frontend is not usable.)
debconf: falling back to frontend: Readline
debconf: unable to initialize frontend: Readline
debconf: (Can't locate Term/ReadLine.pm in @INC (you may need to install the Term::ReadLine module) (@INC contains: /etc/perl /usr/local/lib/x86_64-linux-gnu/perl/5.24.1 /usr/local/share/perl/5.24.1 /usr/lib/x86_64-linux-gnu/perl5/5.24 /usr/share/perl5 /usr/lib/x86_64-linux-gnu/perl/5.24 /usr/share/perl/5.24 /usr/local/lib/site_perl /usr/lib/x86_64-linux-gnu/perl-base .) at /usr/share/perl5/Debconf/FrontEnd/Readline.pm line 7.)
debconf: falling back to frontend: Teletype
Setting up libnginx-mod-http-auth-pam (1.10.3-1+deb9u5) ...
Setting up libnginx-mod-http-dav-ext (1.10.3-1+deb9u5) ...
Setting up libnginx-mod-mail (1.10.3-1+deb9u5) ...
Setting up libnginx-mod-http-xslt-filter (1.10.3-1+deb9u5) ...
Setting up libnginx-mod-http-upstream-fair (1.10.3-1+deb9u5) ...
Setting up libxdmcp6:amd64 (1:1.1.2-3) ...
Setting up xml-core (0.17) ...
Setting up libnginx-mod-http-geoip (1.10.3-1+deb9u5) ...
Setting up libx11-data (2:1.6.4-3+deb9u2) ...
Setting up libxau6:amd64 (1:1.0.8-1) ...
Setting up libwebp6:amd64 (0.5.2-1) ...
Setting up fontconfig-config (2.11.0-6.7) ...
debconf: unable to initialize frontend: Dialog
debconf: (TERM is not set,so the dialog frontend is not usable.)
debconf: falling back to frontend: Readline
debconf: unable to initialize frontend: Readline
debconf: (Can't locate Term/ReadLine.pm in @INC (you may need to install the Term::ReadLine module) (@INC contains: /etc/perl /usr/local/lib/x86_64-linux-gnu/perl/5.24.1 /usr/local/share/perl/5.24.1 /usr/lib/x86_64-linux-gnu/perl5/5.24 /usr/share/perl5 /usr/lib/x86_64-linux-gnu/perl/5.24 /usr/share/perl/5.24 /usr/local/lib/site_perl /usr/lib/x86_64-linux-gnu/perl-base .) at /usr/share/perl5/Debconf/FrontEnd/Readline.pm line 7.)
debconf: falling back to frontend: Teletype
Setting up libnginx-mod-stream (1.10.3-1+deb9u5) ...
Setting up libnginx-mod-http-echo (1.10.3-1+deb9u5) ...
Setting up libxcb1:amd64 (1.12-1) ...
Setting up libfontconfig1:amd64 (2.11.0-6.7+b1) ...
Setting up libx11-6:amd64 (2:1.6.4-3+deb9u2) ...
Setting up libxpm4:amd64 (1:3.5.12-1) ...
Setting up libgd3:amd64 (2.2.4-2+deb9u5) ...
Setting up libnginx-mod-http-image-filter (1.10.3-1+deb9u5) ...
Setting up nginx-full (1.10.3-1+deb9u5) ...
invoke-rc.d: could not determine current runlevel
invoke-rc.d: policy-rc.d denied execution of start.
Setting up nginx (1.10.3-1+deb9u5) ...
Processing triggers for libc-bin (2.24-11+deb9u4) ...
Processing triggers for sgml-base (1.29) ...
Removing intermediate container b1d4c4d5fb1c
 ---> ec084d39789a
Step 3/8 : ADD . /app/
 ---> 1d49a8aae193
Step 4/8 : WORKDIR /app
 ---> Running in 291d3fab8c4f
Removing intermediate container 291d3fab8c4f
 ---> 0905210b7eec
Step 5/8 : RUN npm install
 ---> Running in ce3790948e23
/bin/sh: 1: npm: not found
The command '/bin/sh -c npm install' returned a non-zero code: 127

我是Docker的新手,并关注OC教程。 我尝试完成一个练习,但失败了:

对于这个问题,您将使用openclassrooms / build_image映像作为起始映像来创建Dockerfile。 您的映像必须配备Nginx服务器,因此需要通过Dockerfile安装。完成后,构建并启动您的图像,新的《星球大战》词组将向您展示自己!

C:/用户/桌面/ Docker /

  • .dockerignore
  • Dockerfile

Dockerfile

FROM openclassrooms/build_image

RUN apt-get update \
&& apt-get -y install nginx

ADD . /app/
WORKDIR /app

EXPOSE 2368
VOLUME /app/logs

CMD run -d -p 8080:80 nginx .

我运行docker build -t ocr-docker-build-starwars。建立我的图片并收到错误消息:

命令'/ bin / sh -c apt update && apt install nginx'返回非零代码:1

我的脚本哪里出问题了?

日志

C:\Users\jl3.PRT-063\Desktop\Docker>docker build -t ocr-docker-build-starwars .
Sending build context to Docker daemon  3.072kB
Step 1/8 : FROM openclassrooms/build_image
 ---> 7f6c67ae7dae
Step 2/8 : RUN apt-get update && apt-get install nginx
 ---> Running in 533a0cba0922
Ign:1 http://deb.debian.org/debian stretch InRelease
Get:2 http://security.debian.org/debian-security stretch/updates InRelease [53.0 kB]
Get:3 http://deb.debian.org/debian stretch-updates InRelease [93.6 kB]
Get:4 http://deb.debian.org/debian stretch Release [118 kB]
Get:5 http://deb.debian.org/debian stretch Release.gpg [2410 B]
Get:6 http://security.debian.org/debian-security stretch/updates/main amd64 Packages [558 kB]
Get:7 http://deb.debian.org/debian stretch-updates/main amd64 Packages [2596 B]
Get:8 http://deb.debian.org/debian stretch/main amd64 Packages [7080 kB]
Fetched 7907 kB in 4s (1675 kB/s)
Reading package lists...
Reading package lists...
Building dependency tree...
Reading state information...
The following additional packages will be installed:
  fontconfig-config fonts-dejavu-core geoip-database libbsd0 libexpat1
  libfontconfig1 libfreetype6 libgd3 libgeoip1 libicu57 libjbig0
  libjpeg62-turbo libnginx-mod-http-auth-pam libnginx-mod-http-dav-ext
  libnginx-mod-http-echo libnginx-mod-http-geoip
  libnginx-mod-http-image-filter libnginx-mod-http-subs-filter
  libnginx-mod-http-upstream-fair libnginx-mod-http-xslt-filter
  libnginx-mod-mail libnginx-mod-stream libpng16-16 libssl1.1 libtiff5
  libwebp6 libx11-6 libx11-data libxau6 libxcb1 libxdmcp6 libxml2 libxpm4
  libxslt1.1 nginx-common nginx-full sgml-base ucf xml-core
Suggested packages:
  libgd-tools geoip-bin fcgiwrap nginx-doc ssl-cert sgml-base-doc debhelper
The following NEW packages will be installed:
  fontconfig-config fonts-dejavu-core geoip-database libbsd0 libexpat1
  libfontconfig1 libfreetype6 libgd3 libgeoip1 libicu57 libjbig0
  libjpeg62-turbo libnginx-mod-http-auth-pam libnginx-mod-http-dav-ext
  libnginx-mod-http-echo libnginx-mod-http-geoip
  libnginx-mod-http-image-filter libnginx-mod-http-subs-filter
  libnginx-mod-http-upstream-fair libnginx-mod-http-xslt-filter
  libnginx-mod-mail libnginx-mod-stream libpng16-16 libssl1.1 libtiff5
  libwebp6 libx11-6 libx11-data libxau6 libxcb1 libxdmcp6 libxml2 libxpm4
  libxslt1.1 nginx nginx-common nginx-full sgml-base ucf xml-core
0 upgraded,59.4 MB of additional disk space will be used.
Do you want to continue? [Y/n] Abort.
The command '/bin/sh -c apt-get update && apt-get install nginx' returned a non-zero code: 1

解决方法

由于apt命令提示用户进行确认,因此Docker构建失败。要解决此问题,您可以使用-y标志进行静默安装:

apt-get update \
&& apt-get -y install nginx

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。

相关推荐


依赖报错 idea导入项目后依赖报错,解决方案:https://blog.csdn.net/weixin_42420249/article/details/81191861 依赖版本报错:更换其他版本 无法下载依赖可参考:https://blog.csdn.net/weixin_42628809/a
错误1:代码生成器依赖和mybatis依赖冲突 启动项目时报错如下 2021-12-03 13:33:33.927 ERROR 7228 [ main] o.s.b.d.LoggingFailureAnalysisReporter : *************************** APPL
错误1:gradle项目控制台输出为乱码 # 解决方案:https://blog.csdn.net/weixin_43501566/article/details/112482302 # 在gradle-wrapper.properties 添加以下内容 org.gradle.jvmargs=-Df
错误还原:在查询的过程中,传入的workType为0时,该条件不起作用 <select id="xxx"> SELECT di.id, di.name, di.work_type, di.updated... <where> <if test=&qu
报错如下,gcc版本太低 ^ server.c:5346:31: 错误:‘struct redisServer’没有名为‘server_cpulist’的成员 redisSetCpuAffinity(server.server_cpulist); ^ server.c: 在函数‘hasActiveC
解决方案1 1、改项目中.idea/workspace.xml配置文件,增加dynamic.classpath参数 2、搜索PropertiesComponent,添加如下 <property name="dynamic.classpath" value="tru
删除根组件app.vue中的默认代码后报错:Module Error (from ./node_modules/eslint-loader/index.js): 解决方案:关闭ESlint代码检测,在项目根目录创建vue.config.js,在文件中添加 module.exports = { lin
查看spark默认的python版本 [root@master day27]# pyspark /home/software/spark-2.3.4-bin-hadoop2.7/conf/spark-env.sh: line 2: /usr/local/hadoop/bin/hadoop: No s
使用本地python环境可以成功执行 import pandas as pd import matplotlib.pyplot as plt # 设置字体 plt.rcParams['font.sans-serif'] = ['SimHei'] # 能正确显示负号 p
错误1:Request method ‘DELETE‘ not supported 错误还原:controller层有一个接口,访问该接口时报错:Request method ‘DELETE‘ not supported 错误原因:没有接收到前端传入的参数,修改为如下 参考 错误2:cannot r
错误1:启动docker镜像时报错:Error response from daemon: driver failed programming external connectivity on endpoint quirky_allen 解决方法:重启docker -> systemctl r
错误1:private field ‘xxx‘ is never assigned 按Altʾnter快捷键,选择第2项 参考:https://blog.csdn.net/shi_hong_fei_hei/article/details/88814070 错误2:启动时报错,不能找到主启动类 #
报错如下,通过源不能下载,最后警告pip需升级版本 Requirement already satisfied: pip in c:\users\ychen\appdata\local\programs\python\python310\lib\site-packages (22.0.4) Coll
错误1:maven打包报错 错误还原:使用maven打包项目时报错如下 [ERROR] Failed to execute goal org.apache.maven.plugins:maven-resources-plugin:3.2.0:resources (default-resources)
错误1:服务调用时报错 服务消费者模块assess通过openFeign调用服务提供者模块hires 如下为服务提供者模块hires的控制层接口 @RestController @RequestMapping("/hires") public class FeignControl
错误1:运行项目后报如下错误 解决方案 报错2:Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.8.1:compile (default-compile) on project sb 解决方案:在pom.
参考 错误原因 过滤器或拦截器在生效时,redisTemplate还没有注入 解决方案:在注入容器时就生效 @Component //项目运行时就注入Spring容器 public class RedisBean { @Resource private RedisTemplate<String
使用vite构建项目报错 C:\Users\ychen\work>npm init @vitejs/app @vitejs/create-app is deprecated, use npm init vite instead C:\Users\ychen\AppData\Local\npm-