quit docker run on travis-ci

I’m testing a server that’s designed to run continuously with docker with travis-ci.org. My Dockerfile has a CMD block that prints out some version info then keeps a process foo running. However, docker run -d [docker-image-name] is expected to not quit on itself and I do not want it to keep running on travis-ci.org. I’m using docker kill $(docker ps -q) to quit but the log returns:

$ docker kill $(docker ps -q)
"docker kill" requires at least 1 argument(s).
See 'docker kill --help'.
Usage:  docker kill [OPTIONS] CONTAINER [CONTAINER...]
Kill one or more running containers

Note docker kill $(docker ps -q) runs okay locally.
My .travis.yml is:

  • jenkins pipeline docker build on docker agent
  • Accessing Docker container files from Windows file explorer
  • Memory discrepancy between Kubernetes Dashboard and actual usage
  • How to build Docker Images with Dockerfile behind HTTP_PROXY by Jenkins?
  • PHP-Apache in Docker with only one request in the same time
  • How to write a bash script which automate entering “docker container” and doing other things?
  • sudo: required
    
    language: ruby
    
    services:
      - docker
    
    script:
      - docker build -t test .
      - docker run -d test
      - docker ps -a
      - docker kill $(docker ps -q)
      - docker ps -a
    

    How do I quit the docker process? (Or, does travis-ci automatically quits it/do I have to take care of it myself?)

  • create_network(): failed to allocate gateway (x.x.x.x): Address already in use in test case
  • What is the best practice for Docker CD/CI workflow?
  • How to debug dockerized self-detaching program?
  • Docker API questions
  • docker push - access not authorized
  • Docker Unbound DNS Server: How to launch as service
  • Docker will be the best open platform for developers and sysadmins to build, ship, and run distributed applications.