简体   繁体   English

使用 GitHub 操作在自定义 docker 容器内运行步骤时出现问题

[英]Problem running steps inside custom docker container using GitHub Action

I'm using GH actions for testing a GO application, I created on docker-hub a custom image (guerra1994/go-mqtt-docker) with docker(DiD)/go/mosquitto and in action file I just used with label container: .我正在使用 GH 操作来测试 GO 应用程序,我在 docker-hub 上创建了一个带有 docker(DiD)/go/mosquitto 的自定义图像 (guerra1994/go-mqtt-docker) 以及我刚刚与 label container: . (my expectation is it runs all steps inside the container) (我的期望是它在容器内运行所有步骤)

In one test of the application, there is a test that checks docker ps -a command, I expect that return empty result but it returns one container is present, that container is mine like container runs by the runner of actions see "host" container or maybe it creates as "brother" container and not as "child".在应用程序的一项测试中,有一个测试检查docker ps -a命令,我希望返回空结果,但它返回一个容器存在,该容器是我的,就像由动作运行者运行的容器一样,请参阅“主机”容器或者它可能创建为“兄弟”容器而不是“孩子”。

I don't really understand what is happening... Some can help me?我真的不明白发生了什么......有人可以帮助我吗?

Another workaround is to create an executable docker image that runs all command to execute tests directly in ENTRYPOINT另一种解决方法是创建一个可执行的 docker 映像,该映像运行所有命令以直接在ENTRYPOINT中执行测试

The probel is -v /var/run/docker.sock:/var/run/docker.sock that allows your container to see other in your host machine探针是-v /var/run/docker.sock:/var/run/docker.sock ,它允许您的容器在您的主机中看到其他

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM