Run py.test in a docker container as a service

I am working on setting up a dockerised selenium grid. I can send my python tests [run with pytest] from a pytest container [see below] by attaching to it.
But I have setup another LAMP container that is going to control pytest.
So I want to make the pytest container standalone,running idle and waiting for commands from the LAMP container.

I have this Dockerfile:

  • Adding custom folder to Docker using sbt-native-packager in Play JPA project
  • Docker container has trouble mounting volume with Jenkins
  • Iterate in RUN command in Dockerfile
  • multiple SLF4J bindings on maven run in docker
  • How to use docker-machine on a private server?
  • boot2docker / docker “Error. image library/.:latest not found”
  • # Starting from base image
    FROM ubuntu
    
    #-----------------------------------------------------
    # Set the Github personal token
    ENV GH_TOKEN blablabla
    
    # Install Python & pip
    RUN apt-get update
    RUN apt-get upgrade -y
    RUN apt-get install -y python python-pip python-dev && pip install --upgrade pip
    
    # Install nano for #debugging
    RUN apt-get install -y nano
    
    # Install xvfb
    RUN apt-get install -y xvfb
    
    # Install GIT
    RUN apt-get update -y && apt-get install git -y
    
    # [in the / folder] 
    RUN git clone https://$GH_TOKEN:x-oauth-basic@github.com/user/project.git /project
    
    # Install dependencies via pip
    WORKDIR /project
    RUN pip install -r dependencies.txt
    #-----------------------------------------------------
    
    #
    CMD ["/bin/bash"]
    

    I start the pytest container manually [for development] with this:

    docker run -dit -v /project --name pytest repo/user:py
    

    The thing is that I finished development and I want to have the pytest container launched from docker-compose and connect it to other containers [with link and volume].
    I just cannot make it to stay up .

    I used this :

    pytest:
      image: repo/user:py
      volumes:
        - "/project"
      command: "/bin/bash tail -f /dev/null"
    

    but didnt work.

    So, inside the Dockerfile, should I use a specific CMD or ENTRYPOINT ?

    Should I use some command from the docker-compose file?

  • JAVA 6 Docker client
  • How to manage Docker server by multi clients
  • Docker Compose: Accessing my webapp from the browser
  • Run Docker by using shell script from remote machine?
  • Docker build: unable to fetch archives
  • How to do a “docker-compose” in a “docker machine”?
  • Docker will be the best open platform for developers and sysadmins to build, ship, and run distributed applications.