skip to Main Content

Ran the command docker-compose up -d
enter image description here
got this error : Error response from daemon: lease "moby-image-sha256:c2740b69f111bd711c867e337c12bab4b3d720c987e0d09549fe95e6badc6ba8": not found

No idea what this means. I am on a M1.This is my docker files :

version: '3.9'

services:
  telikos-activityplanworkflow-service:
    container_name: telikos-activityplanworkflow-service
    build:
      context: .
      dockerfile: Dockerfile
    depends_on:
      ##----Dependent images-----------
      broker:
        condition: service_healthy
      mongo:
        condition: service_started
    ##---Ports-------------
    ports:
      - 8080:8080
    expose:
      - 8080
    ##---Environment variables------------
    environment:
      - server.port=8080
      - kafkabootstrapservers=broker:9092
  ##-----------------------------------------
  #----docker-images------------------------------------------------------


  zookeeper:
    image: confluentinc/cp-zookeeper:6.2.0
    hostname: zookeeper
    container_name: zookeeperap
    ports:
      - "2181:2181"
    environment:
      ZOOKEEPER_CLIENT_PORT: 2181
      ZOOKEEPER_TICK_TIME: 2000

  broker:
    image: confluentinc/cp-server:6.2.0
    hostname: broker
    container_name: brokerap
    depends_on:
      - zookeeper
    ports:
      - "29092:29092"
      - "9101:9101"
    environment:
      KAFKA_BROKER_ID: 1
      ALLOW_PLAINTEXT_LISTENER: "yes"
      KAFKA_ZOOKEEPER_CONNECT: 'zookeeper:2181'
      KAFKA_LISTENER_SECURITY_PROTOCOL_MAP: PLAINTEXT:PLAINTEXT,PLAINTEXT_HOST:PLAINTEXT
      KAFKA_ADVERTISED_LISTENERS: PLAINTEXT://broker:9092,PLAINTEXT_HOST://localhost:29092
      KAFKA_METRIC_REPORTERS: io.confluent.metrics.reporter.ConfluentMetricsReporter
      KAFKA_OFFSETS_TOPIC_REPLICATION_FACTOR: 1
      KAFKA_GROUP_INITIAL_REBALANCE_DELAY_MS: 0
      KAFKA_CONFLUENT_LICENSE_TOPIC_REPLICATION_FACTOR: 1
      KAFKA_CONFLUENT_BALANCER_TOPIC_REPLICATION_FACTOR: 1
      KAFKA_TRANSACTION_STATE_LOG_MIN_ISR: 1
      KAFKA_TRANSACTION_STATE_LOG_REPLICATION_FACTOR: 1
      KAFKA_JMX_PORT: 9101
      KAFKA_JMX_HOSTNAME: localhost
      KAFKA_CONFLUENT_SCHEMA_REGISTRY_URL: http://schema-registry:8081
      CONFLUENT_METRICS_REPORTER_BOOTSTRAP_SERVERS: broker:9092
      CONFLUENT_METRICS_REPORTER_TOPIC_REPLICAS: 1
      CONFLUENT_METRICS_ENABLE: 'true'
      CONFLUENT_SUPPORT_CUSTOMER_ID: 'anonymous'
    healthcheck:
      test: nc -z localhost 29092 || exit -1
      start_period: 25s
      interval: 10s
      timeout: 10s
      retries: 10


  mongo:
    container_name: mongoap
    image: mongo
    ports:
      - 27017:27017
    environment:
      MONGO_INITDB_ROOT_USERNAME: admin
      MONGO_INITDB_ROOT_PASSWORD: password
    healthcheck:
      test: echo 'db.runCommand("ping").ok' | mongo mongo:27017/test --quiet
      start_period: 40s
      interval: 15s
      timeout: 10s
      retries: 5

  mongo-express:
    image: mongo-express
    restart: always
    ports:
      - 8081:8081
    environment:
      ME_CONFIG_MONGODB_ADMINUSERNAME: admin
      ME_CONFIG_MONGODB_ADMINPASSWORD: password
      ME_CONFIG_MONGODB_URL: mongodb://admin:password@mongo:27017/

DockerFile :

FROM bellsoft/liberica-openjdk-alpine:17
RUN apk add curl
VOLUME /tmp
WORKDIR /app
COPY target/telikos-activityplanworkflow-service.jar /app/
ADD --chown=15000:15000 'https://github.com/open-telemetry/opentelemetry-java-instrumentation/releases/latest/download/opentelemetry-javaagent.jar' opentelemetry-javaagent.jar
ENTRYPOINT ["java", "-javaagent:opentelemetry-javaagent.jar", "-jar", "telikos-activityplanworkflow-service.jar"]

I was trying to run kafka and zookeeper in docker using the docker file above. I have no idea what this means.

3

Answers


  1. The error message you encountered, "Error response from daemon: lease ‘moby-image-sha256:c2740b69f111bd711c867e337c12bab4b3d720c987e0d09549fe95e6badc6ba8’: not found," is related to Docker and indicates an issue with pulling or retrieving a Docker image. The image mentioned in the error is not found or accessible.

    Here are a few possible solutions to try:

    Check your internet connectivity: Ensure that your internet connection is stable and functioning properly. Docker needs a working internet connection to pull images from repositories.

    Pull the required images manually: If you suspect that the required images are not being pulled automatically, you can try pulling them manually before running docker-compose up. For example, you can run the following commands separately:

    docker pull confluentinc/cp-zookeeper:6.2.0
    docker pull confluentinc/cp-server:6.2.0
    docker pull mongo
    docker pull mongo-express

    This will download the necessary images onto your system, and then you can try running docker-compose up again.

    Clear Docker cache: Docker may sometimes encounter issues related to caching. You can try clearing the Docker cache and then running docker-compose up again. Keep in mind that this will remove all local images and containers, so make sure to back up any important data.

    docker system prune -a --volumes

    Upgrade Docker: If you are using an older version of Docker, consider upgrading to the latest stable release. Newer versions may contain bug fixes and improvements that could resolve the issue.

    Verify Docker configuration: Ensure that your Docker configuration is correctly set up and that you have the necessary permissions to access and pull Docker images. Verify your Docker installation and make sure it is properly configured for your operating system.

    By following these steps, you should be able to address the "not found" error and successfully run your Docker containers using docker-compose up.

    Login or Signup to reply.
  2. In general, leases are resources in containerd which are created by clients and are used to reference other resources such as snapshots and content, as stated in this link.

    To solve the problem, you should cleanup your environment. So delete the containers you have with docker rm <container> commands, delete the images with docker rmi <image> and then remove the leases from containerd’s root directory /var/lib/container.

    Login or Signup to reply.
  3. If you have successfully pulled the required Docker images and verified that MongoDB and ZooKeeper are running, but you are still facing issues with your service running inside the container, there might be other factors causing the problem. Here are a few troubleshooting steps you can try:

    Check the logs: Run docker-compose logs to view the logs of all containers. Look for any error messages or relevant information that could help identify the issue with your service container.

    Check the service configuration: Double-check your service’s configuration within the Docker Compose file. Ensure that the necessary environment variables, volumes, and ports are correctly defined. Make sure the service is dependent on the required services (e.g., MongoDB and ZooKeeper) using the depends_on directive.

    Verify the container status: Run docker ps to see the status of your containers. Check if the service container is running or if it has exited with an error. If the container is not running, you can inspect the container’s logs specifically by running docker logs <container_name>.

    Verify the container’s health checks: If you have health checks defined for your service container in the Docker Compose file, ensure they are correctly configured. Health checks can help ensure that the container is in a healthy state before considering it fully running.

    Confirm the service’s configuration: Ensure that your service’s configuration is compatible with the container environment. For example, check if the service’s port is correctly exposed and mapped to the host machine’s port in the Docker Compose file.

    Run the service container interactively: You can try running the service container interactively with a shell to debug the issue. Use the docker-compose run <service_name> sh command to start the container in interactive mode, replacing <service_name> with the name of your service container. This allows you to access the container’s shell and investigate further.

    Test the service locally: If possible, try running your service locally outside the container environment to verify that it works correctly. This helps isolate whether the issue is specific to the container setup or if it exists in the service code itself.

    By going through these steps, you should be able to gather more information about the issue and narrow down the possible causes of the problem.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search