-1

Here is my .env file :

PUID=1000
PGID=1000
TZ="Europe/Paris"
USERDIR="/home/sylvain"
DOCKERDIR="/home/sylvain/docker"
DATADIR="/srv/storage"

Here is my composer file :

version: "3.9"

################ NETWORKS
# You may customize the network subnet (192.168.89.0/24) below as you please.
# Docker Compose version 3.5 or higer required to define networks this way.

networks:
  default:
    driver: bridge
  npm_proxy:
    name: npm_proxy
    driver: bridge
    ipam:
      config:
        - subnet: 192.168.89.0/24
########################### EXTENSION FIELDS
# Helps eliminate repetition of sections
# More Info on how to use this: https://github.com/htpcBeginner/docker-traefik/pull/228

# Common environment values
x-environment: &default-tz-puid-pgid
  TZ: $TZ
  PUID: $PUID
  PGID: $PGID

# Keys common to some of the core services that we always to automatically restart on failure
x-common-keys-core: &common-keys-core
  security_opt:
    - no-new-privileges:true
  restart: always

# Keys common to some of the dependent services/apps
x-common-keys-apps: &common-keys-apps
  networks:
    - npm_proxy
  security_opt:
    - no-new-privileges:true
  restart: unless-stopped

# Keys common to some of the services in media-services.txt
x-common-keys-media: &common-keys-media
  networks:
    - npm_proxy
  security_opt:
   - no-new-privileges:true
  restart: "no"

################# SERVICES
services:
  portainer:
    <<: *common-keys-core
    container_name: portainer
    image: portainer/portainer-ce:latest
    command: -H unix:///var/pun/docker.sock
    #command: -H tcp://socket-proxy:2375 # Use this instead, if you have Socket Proxy enabled.
    ports:
      - 9000:9000
    volumes:
      - /var/run/docker.sock:/var/run/docker.sock:ro
      - $DOCKERDIR/appdata/portainer/data:/data
    environment:
      - TZ=$TZ

WHen I start portainer I have the following logs : portainer | 2022-08-14T18:33:47.367944332Z time="2022-08-14T18:33:47Z" level=fatal msg="Failed validating flags:Unable to locate Unix socket or named pipe"

I start with : sudo docker compose -f ~/docker/docker-compose.yml up -d I see logs using : sudo docker compose -f ~/docker/docker-compose.yml logs -tf --tail="50" portainer

I think my problem is that I followed a tutorial that use Nginx Proxy Manager (NPM) and I am trying to not use it (I have a 5G home internet). WHat is wrong in my config ?

Sylario
  • 99
  • 1
  • 11

1 Answers1

0

If there is no reason as to why have you commented the command line when defining Portainer service, Please uncomment it. This will allow portainer to use Unix socket. In summary, the following line should be uncommented.

-H unix:///var/pun/docker.sock

Alternatively,

In the event you have socket proxy enabled. This should work.

-H tcp://socket-proxy:2375

See this: Portainer Docker Compose