我们如何调试处于不健康状态的Docker容器?

我们如何调试处于不健康状态的Docker容器?,docker,intersystems-iris,Docker,Intersystems Iris,我们遵循本教程,以便能够使用数据平台IRIS: 我们发现了一个问题,因为它看起来像是教程中要求的IRIS版本,在下载页面上不再可用 我们已下载了最接近的版本,即: InterSystems IRIS 2019.4 然后,我们尝试按照以下步骤进行操作: docker load -i iris-2019.4.0.383.0-docker.tar.gz 它输出: Loaded image: intersystems/iris:2019.4.0.383.0 然后我们下载了网络研讨会代码: git

我们遵循本教程,以便能够使用数据平台IRIS:

我们发现了一个问题,因为它看起来像是教程中要求的IRIS版本,在下载页面上不再可用

我们已下载了最接近的版本,即:

InterSystems IRIS
2019.4
然后,我们尝试按照以下步骤进行操作:

docker load -i iris-2019.4.0.383.0-docker.tar.gz
它输出:

Loaded image: intersystems/iris:2019.4.0.383.0
然后我们下载了网络研讨会代码:

git clone https://github.com/es-comunidad-intersystems/webinar-gestion-apis.git
之后,我们尝试构建Docker形象,如下所示:

docker build . --tag webinar-gestion-apis:stable --no-cache
我们已经看到了结果:

Sending build context to Docker daemon  754.2kB
Step 1/9 : FROM intersystems/iris:2019.3.0.302.0
pull access denied for intersystems/iris, repository does not exist or may require 'docker login': denied: requested access to the resource is denied
Sending build context to Docker daemon  758.8kB
Step 1/9 : FROM intersystems/iris:2019.4.0.383.0
 ---> 46e2532c2583
Step 2/9 : USER root
 ---> Running in 3de765837aa5
Removing intermediate container 3de765837aa5
 ---> 35a7d04b1f5a
Step 3/9 : RUN mkdir -p /opt/webinar/install
 ---> Running in 1b1690dff84f
Removing intermediate container 1b1690dff84f
 ---> 64d42f352bb9
Step 4/9 : COPY install /opt/webinar/install
 ---> 2710ae3d8265
Step 5/9 : RUN mkdir -p /opt/webinar/src
 ---> Running in 12ccd30d880b
Removing intermediate container 12ccd30d880b
 ---> c2e5d7dff819
Step 6/9 : COPY src /opt/webinar/src/
 ---> 943d888243a9
Step 7/9 : RUN chown -R ${ISC_PACKAGE_MGRUSER}:${ISC_PACKAGE_IRISGROUP} /opt/webinar
 ---> Running in 57a5b34bbf70
Removing intermediate container 57a5b34bbf70
 ---> a8629b4948a0
Step 8/9 : USER irisowner
 ---> Running in 93d6814d7452
Removing intermediate container 93d6814d7452
 ---> 4e9faf862ebe
Step 9/9 : RUN iris start iris &&     printf 'zn "USER" \n     do $system.OBJ.Load("/opt/webinar/src/Webinar/Installer.cls","c")\n     do ##class(Webinar.Installer).Run()\n     zn "%%SYS"\n     do ##class(SYS.Container).QuiesceForBundling()\n     h\n' | irissession IRIS && iris stop iris quietly
 ---> Running in 2e28a60b29b4
Using 'iris.cpf' configuration file

This copy of InterSystems IRIS has been licensed for use exclusively by:
Local license key file not found.
Copyright (c) 1986-2019 by InterSystems Corporation
Any other use is a violation of your license agreement

1 alert(s) during startup. See messages.log for details.
Starting IRIS


Node: 2e28a60b29b4, Instance: IRIS

USER>

USER>

Load started on 06/13/2020 08:18:52
Loading file /opt/webinar/src/Webinar/Installer.cls as udl
Compiling class Webinar.Installer
Compiling routine Webinar.Installer.1
Load finished successfully.

USER>
START INSTALLER
2020-06-13 08:18:58 0 Webinar.Installer: Installation starting at 2020-06-13 08:18:58, LogLevel=0
2020-06-13 08:18:58 0 : Creating namespace WEBINAR

Load of directory started on 06/13/2020 08:19:08

Loading file /opt/webinar/src/Webinar/Installer.cls as udl
Loading file /opt/webinar/src/Webinar/API/Leaderboard/v1/impl.cls as udl
Loading file /opt/webinar/src/Webinar/API/Leaderboard/v1/spec.cls as udl
Loading file /opt/webinar/src/Webinar/Data/Player.cls as udl
Loading file /opt/webinar/src/Webinar/Data/Team.cls as udl

Compilation started on 06/13/2020 08:19:08 with qualifiers 'cuk'
Compiling 5 classes, using 2 worker jobs
Compiling class Webinar.API.Leaderboard.v1.impl
Compiling class Webinar.API.Leaderboard.v1.spec
Compiling class Webinar.Data.Player
Compiling class Webinar.Installer
Compiling class Webinar.Data.Team
Compiling table Webinar_Data.Player
Compiling table Webinar_Data.Team
Compiling routine Webinar.API.Leaderboard.v1.impl.1
Compiling routine Webinar.Data.Team.1
Compiling routine Webinar.Installer.1
Compiling routine Webinar.Data.Player.1
Compiling class Webinar.API.Leaderboard.v1.impl
Compiling class Webinar.API.Leaderboard.v1.disp
Compiling routine Webinar.API.Leaderboard.v1.impl.1
Compiling routine Webinar.API.Leaderboard.v1.disp.1
Compilation finished successfully in 0.470s.

Load finished successfully.

Load started on 06/13/2020 08:19:09
Loading file /opt/webinar/install/WebTerminal-v4.9.0.xml as xml
Imported class: WebTerminal.Analytics
Imported class: WebTerminal.Autocomplete
Imported class: WebTerminal.Common
Imported class: WebTerminal.Core
Imported class: WebTerminal.Engine
Imported class: WebTerminal.ErrorDecomposer
Imported class: WebTerminal.Handlers
Imported class: WebTerminal.Installer
Imported class: WebTerminal.Router
Imported class: WebTerminal.StaticContent
Imported class: WebTerminal.Trace
Imported class: WebTerminal.Updater
Compiling 12 classes, using 2 worker jobs
Compiling class WebTerminal.Analytics
Compiling class WebTerminal.ErrorDecomposer
Compiling class WebTerminal.Common
Compiling class WebTerminal.StaticContent
Compiling class WebTerminal.Handlers
Compiling class WebTerminal.Updater
Compiling class WebTerminal.Autocomplete
Compiling class WebTerminal.Core
Compiling class WebTerminal.Trace
Compiling class WebTerminal.Router
Compiling class WebTerminal.Engine
Compiling routine WebTerminal.Analytics.1
Compiling routine WebTerminal.ErrorDecomposer.1
Compiling routine WebTerminal.Common.1
Compiling routine WebTerminal.StaticContent.1
Compiling routine WebTerminal.Updater.1
Compiling routine WebTerminal.Handlers.1
Compiling routine WebTerminal.Core.1
Compiling routine WebTerminal.Router.1
Compiling routine WebTerminal.Trace.1
Compiling routine WebTerminal.Autocomplete.1
Compiling routine WebTerminal.Engine.1
Compiling class WebTerminal.Installer
Compiling routine WebTerminal.Installer.1
Installing WebTerminal application to WEBINAR
Creating WEB application "/terminal"...
WEB application "/terminal" is created.
Assigning role %DB_IRISSYS to a web application; resulting roles: :%DB_IRISSYS:%DB_USER
Creating WEB application "/terminalsocket"...
WEB application "/terminalsocket" is created.
%All namespace is created.
Mapping %WebTerminal package into all namespaces: %All
WebTerminal package successfully mapped into all namespaces.
Load finished successfully.
2020-06-13 08:19:09 0 Webinar.Installer: Installation succeeded at 2020-06-13 08:19:09
2020-06-13 08:19:09 0 %Installer: Elapsed time 11.29037s

INSTALLER SUCCESS

USER>

%SYS>

%SYS>
Removing intermediate container 2e28a60b29b4
 ---> e23ab1a58cd2
Successfully built e23ab1a58cd2
Successfully tagged webinar-gestion-apis:stable
SECURITY WARNING: You are building a Docker image from Windows against a non-Windows Docker host. All files and directories added to build context will have '-rwxr-xr-x' permissions. It is recommended to double check and reset permissions for sensitive files and directories.
因此,我们认为这个问题与Dockerfile有关,因为它有以下命令:

# building from the InterSystems IRIS
FROM intersystems/iris:2019.3.0.302.0
为了调整它以获得我们下载的verion,我们编写了:

# building from the InterSystems IRIS
FROM intersystems/iris:2019.4.0.383.0
因此,在这之后,我们写道:

docker build . --tag webinar-gestion-apis:stable --no-cache
并正确安装了图像:

作为输出:

Sending build context to Docker daemon  754.2kB
Step 1/9 : FROM intersystems/iris:2019.3.0.302.0
pull access denied for intersystems/iris, repository does not exist or may require 'docker login': denied: requested access to the resource is denied
Sending build context to Docker daemon  758.8kB
Step 1/9 : FROM intersystems/iris:2019.4.0.383.0
 ---> 46e2532c2583
Step 2/9 : USER root
 ---> Running in 3de765837aa5
Removing intermediate container 3de765837aa5
 ---> 35a7d04b1f5a
Step 3/9 : RUN mkdir -p /opt/webinar/install
 ---> Running in 1b1690dff84f
Removing intermediate container 1b1690dff84f
 ---> 64d42f352bb9
Step 4/9 : COPY install /opt/webinar/install
 ---> 2710ae3d8265
Step 5/9 : RUN mkdir -p /opt/webinar/src
 ---> Running in 12ccd30d880b
Removing intermediate container 12ccd30d880b
 ---> c2e5d7dff819
Step 6/9 : COPY src /opt/webinar/src/
 ---> 943d888243a9
Step 7/9 : RUN chown -R ${ISC_PACKAGE_MGRUSER}:${ISC_PACKAGE_IRISGROUP} /opt/webinar
 ---> Running in 57a5b34bbf70
Removing intermediate container 57a5b34bbf70
 ---> a8629b4948a0
Step 8/9 : USER irisowner
 ---> Running in 93d6814d7452
Removing intermediate container 93d6814d7452
 ---> 4e9faf862ebe
Step 9/9 : RUN iris start iris &&     printf 'zn "USER" \n     do $system.OBJ.Load("/opt/webinar/src/Webinar/Installer.cls","c")\n     do ##class(Webinar.Installer).Run()\n     zn "%%SYS"\n     do ##class(SYS.Container).QuiesceForBundling()\n     h\n' | irissession IRIS && iris stop iris quietly
 ---> Running in 2e28a60b29b4
Using 'iris.cpf' configuration file

This copy of InterSystems IRIS has been licensed for use exclusively by:
Local license key file not found.
Copyright (c) 1986-2019 by InterSystems Corporation
Any other use is a violation of your license agreement

1 alert(s) during startup. See messages.log for details.
Starting IRIS


Node: 2e28a60b29b4, Instance: IRIS

USER>

USER>

Load started on 06/13/2020 08:18:52
Loading file /opt/webinar/src/Webinar/Installer.cls as udl
Compiling class Webinar.Installer
Compiling routine Webinar.Installer.1
Load finished successfully.

USER>
START INSTALLER
2020-06-13 08:18:58 0 Webinar.Installer: Installation starting at 2020-06-13 08:18:58, LogLevel=0
2020-06-13 08:18:58 0 : Creating namespace WEBINAR

Load of directory started on 06/13/2020 08:19:08

Loading file /opt/webinar/src/Webinar/Installer.cls as udl
Loading file /opt/webinar/src/Webinar/API/Leaderboard/v1/impl.cls as udl
Loading file /opt/webinar/src/Webinar/API/Leaderboard/v1/spec.cls as udl
Loading file /opt/webinar/src/Webinar/Data/Player.cls as udl
Loading file /opt/webinar/src/Webinar/Data/Team.cls as udl

Compilation started on 06/13/2020 08:19:08 with qualifiers 'cuk'
Compiling 5 classes, using 2 worker jobs
Compiling class Webinar.API.Leaderboard.v1.impl
Compiling class Webinar.API.Leaderboard.v1.spec
Compiling class Webinar.Data.Player
Compiling class Webinar.Installer
Compiling class Webinar.Data.Team
Compiling table Webinar_Data.Player
Compiling table Webinar_Data.Team
Compiling routine Webinar.API.Leaderboard.v1.impl.1
Compiling routine Webinar.Data.Team.1
Compiling routine Webinar.Installer.1
Compiling routine Webinar.Data.Player.1
Compiling class Webinar.API.Leaderboard.v1.impl
Compiling class Webinar.API.Leaderboard.v1.disp
Compiling routine Webinar.API.Leaderboard.v1.impl.1
Compiling routine Webinar.API.Leaderboard.v1.disp.1
Compilation finished successfully in 0.470s.

Load finished successfully.

Load started on 06/13/2020 08:19:09
Loading file /opt/webinar/install/WebTerminal-v4.9.0.xml as xml
Imported class: WebTerminal.Analytics
Imported class: WebTerminal.Autocomplete
Imported class: WebTerminal.Common
Imported class: WebTerminal.Core
Imported class: WebTerminal.Engine
Imported class: WebTerminal.ErrorDecomposer
Imported class: WebTerminal.Handlers
Imported class: WebTerminal.Installer
Imported class: WebTerminal.Router
Imported class: WebTerminal.StaticContent
Imported class: WebTerminal.Trace
Imported class: WebTerminal.Updater
Compiling 12 classes, using 2 worker jobs
Compiling class WebTerminal.Analytics
Compiling class WebTerminal.ErrorDecomposer
Compiling class WebTerminal.Common
Compiling class WebTerminal.StaticContent
Compiling class WebTerminal.Handlers
Compiling class WebTerminal.Updater
Compiling class WebTerminal.Autocomplete
Compiling class WebTerminal.Core
Compiling class WebTerminal.Trace
Compiling class WebTerminal.Router
Compiling class WebTerminal.Engine
Compiling routine WebTerminal.Analytics.1
Compiling routine WebTerminal.ErrorDecomposer.1
Compiling routine WebTerminal.Common.1
Compiling routine WebTerminal.StaticContent.1
Compiling routine WebTerminal.Updater.1
Compiling routine WebTerminal.Handlers.1
Compiling routine WebTerminal.Core.1
Compiling routine WebTerminal.Router.1
Compiling routine WebTerminal.Trace.1
Compiling routine WebTerminal.Autocomplete.1
Compiling routine WebTerminal.Engine.1
Compiling class WebTerminal.Installer
Compiling routine WebTerminal.Installer.1
Installing WebTerminal application to WEBINAR
Creating WEB application "/terminal"...
WEB application "/terminal" is created.
Assigning role %DB_IRISSYS to a web application; resulting roles: :%DB_IRISSYS:%DB_USER
Creating WEB application "/terminalsocket"...
WEB application "/terminalsocket" is created.
%All namespace is created.
Mapping %WebTerminal package into all namespaces: %All
WebTerminal package successfully mapped into all namespaces.
Load finished successfully.
2020-06-13 08:19:09 0 Webinar.Installer: Installation succeeded at 2020-06-13 08:19:09
2020-06-13 08:19:09 0 %Installer: Elapsed time 11.29037s

INSTALLER SUCCESS

USER>

%SYS>

%SYS>
Removing intermediate container 2e28a60b29b4
 ---> e23ab1a58cd2
Successfully built e23ab1a58cd2
Successfully tagged webinar-gestion-apis:stable
SECURITY WARNING: You are building a Docker image from Windows against a non-Windows Docker host. All files and directories added to build context will have '-rwxr-xr-x' permissions. It is recommended to double check and reset permissions for sensitive files and directories.
现在的困难是,当我们试图运行容器时,它会显示“不健康”

产出是:

Starting iris-2019.4 ... done
作为docker-compose.yml(我们保留了原始的git hub repo文件,只是将容器名称从iris-2019.3更改为iris-2019.4)

当我们尝试使用:

docker-compose ps
我们观察到:

   Name        Command         State                              Ports
----------------------------------------------------------------------------------------------
iris-2019.4   /iris-main   Up (unhealthy)   0.0.0.0:51773->51773/tcp, 0.0.0.0:52773->52773/tcp
如果我们尝试调试它并查看日志,我们有:

docker inspect --format "{{json .State.Health }}" iris-2019.4
它表明:

{"Status":"unhealthy","FailingStreak":4,"Log":[{"Start":"2020-06-13T08:30:56.232804406Z","End":"2020-06-13T08:30:56.328718067Z","ExitCode":1,"Output":""},{"Start":"2020-06-13T08:31:56.332937629Z","End":"2020-06-13T08:31:56.427169416Z","ExitCode":1,"Output":""},{"Start":"2020-06-13T08:32:56.43026636Z","End":"2020-06-13T08:32:56.5141952Z","ExitCode":1,"Output":""},{"Start":"2020-06-13T08:33:56.520060854Z","End":"2020-06-13T08:33:56.605017629Z","ExitCode":1,"Output":""}]}
是我们无法连接到的结果:

http://localhost:52773/csp/sys/UtilHome.csp
我们如何调试处于不健康状态的Docker容器