简体   繁体   中英

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: . (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".

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

The probel is -v /var/run/docker.sock:/var/run/docker.sock that allows your container to see other in your host machine

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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