Nitai Chandra Banik
Nitai Chandra Banik

Reputation: 102

Can't run jenkins image in docker

I have just started to learn Docker. I have tried to run jenkins in my docker.

I have tried the commands: docker run jenkins , docker run jenkins:latest

But showing the error in the docker interactive shell: C:\Program Files\Docker Toolbox\docker.exe: Error response from daemon: manifest for jenkins:latest not found: manifest unknown: manifest unknown.

Upvotes: 1

Views: 1995

Answers (1)

TudorIftimie
TudorIftimie

Reputation: 1140

You can run the container by using the command

docker run -p 8080:8080 -p 50000:50000 jenkins/jenkins:lts

The documentation page is pretty good.

I would use a docker-compose file to

  • mount a volume for home to make it persistent (in order to look into the build workspace you need to attach another container to it)
  • control the version programmatically
  • add docker client or other utilities installed later
  • add 'fixed' agents

docker compose file:

version: '3.5'
services:
  jenkins-server:
    build: ./JenkinsServer
    container_name: jenkins
    restart: always
    environment:
      JAVA_OPTS: "-Xmx1024m"
    ports:
      - "50000:50000"
      - "8080:8080"
    networks:
      jenkins:
        aliases:
          - jenkins
    volumes:
      - jenkins-data:/var/jenkins_home

networks:
  jenkins:
    external: true

volumes:
  jenkins-data:
    external: true

dockerfile for server:

FROM jenkins/jenkins:2.263.2-lts
USER root

Upvotes: 3

Related Questions