VishwaV
VishwaV

Reputation: 167

docker ps command returns nothing

enter image description hereI'm using a docker container for jenkins and successfully came to the 'docker-compose up -d' step which returned 'starting jenkins.. done'

I now tried 'docker ps' which returns empty.

On trying 'docker images', it returned the jenkins image in the list.

Can you please tell me why this is happening and possible solutions? I'm doing the entire process as the root user.

The docker-compose.yml file looks like this:

version: '3'
services:
  jenkins:
    container_name: jenkins
    image: jenkins/jenkins
    ports:
      - "8080:8080"
    volumes:
      - "$PWD/jenkins_home:/var/jenkins_home"
    networks:
      - net
networks:
  net:

Upvotes: 0

Views: 223

Answers (1)

Amit Meena
Amit Meena

Reputation: 4424

I tried re-creating the issue but the compose file is working for me.

docker ps output:

$ docker ps
CONTAINER ID   IMAGE             COMMAND                  CREATED         STATUS         PORTS                               NAMES
96a5965ceab7   jenkins/jenkins   "/sbin/tini -- /usr/…"   7 minutes ago   Up 6 minutes   0.0.0.0:8080->8080/tcp, 50000/tcp   jenkins

$ docker compose up -d
Network "docker-compose-jenkins_net"  Creating
Network "docker-compose-jenkins_net"  Created
Container jenkins  Creating
Container jenkins  Created
Container jenkins  Starting
Container jenkins  Started

Could you please check that your root user is able to create the jenkins home directory in the current working directory i.e jenkins-data.

If the root is not able to create the home dir then the container will not start. You can choose another folder in that case.

Regards Amit Meena

Upvotes: 1

Related Questions