nerdctl compose error: FATA[0000] error while creating container portainer: exit status 1

564 Views Asked by At

I am running lima on a M1 mac with OSX Ventura. I have a docker compose file that works perfectly when I try to run it with docker cli.

docker-compose:

version: "3.8"
services:
  portainer:
    container_name: portainer
    image: portainer/portainer-ce:latest
    volumes:
      - ~/docker/portainer/data:/data
      - /var/run/docker.sock:/var/run/docker.sock
    restart: always
    ports:
      - "9443:9443"

When I run the below command

nerdctl compose --env-file ../macbook.env up --debug-full

The command fails with the following error.

FATA[0000] error while creating container portainer: exit status 1

Needless to say this is not enough information for me to diagnose the issue. Is there a way to find out exactly whats failing? Basically how do I get this simple docker-compose file to run so I can start adding more services to it.

1

There are 1 best solutions below

0
On

mount a local volume in to the container at the location wher the portainer application logs are output.

This will output logs to a file in the directory on your local machine that you can then consult for further information

eg. (probably not correct) /tmp/portainerLogs:/var/logs/portainer

If you can run the container without any customising, you can ssh into the container with docker exec -it [container_id] bash which will effectively log you into the container with a bash shell prompt. -i - interactive, -t teletypewriter (connect the keyboard). Once in locate the logs and mount the directory as needed.

I'd probably be querying the portainer image with something like docker image inspect [imageId] --no-trunc - this should give you info that was used to create the docker container (similar to the directives for the Dockerfile used to create the image). Perhaps the log dir is there?

Also on my M1 MBP I see there may be a way to bypass this entirely and look on your local machine since reportedly container log output goes to:

/var/lib/docker/containers/<container_id>/<container_id>-json.log

However on my M1 MBP I see a similar directory at:

/var/containers/ but mine is empty since I've not really used it much for dev.