H
H
HexUserHex2020-08-21 17:32:25
Docker
HexUserHex, 2020-08-21 17:32:25

Changing default portainer(9000) port in docker-compose?

In my docker-compose there is php-fpm, both of these services by default listen to port 9000, i.e. when php-fpm then portainer starts to swear and writes that the port it needs (9000) is the bind port.
I try to change the port for portainer to 9001, the stack itself starts BUT I can’t get access to the web panel of portainer, swears that it can’t find the path to sh / bash in the $ PATH environment variable.

An example of changing the default port in portainer (everything works from 9000 in this example)

version: '2'
services:
  portainer:
    image: portainer/portainer
    container_name: portainer
    command: -H unix:///var/run/docker.sock
    ports:
      - 9001:9001
    volumes:
      - /var/run/docker.sock:/var/run/docker.sock
      - /opt/appdata/portainer:/data
    restart: always


#docker exec -it 1cde9bea001d  sh
OCI runtime exec failed: exec failed: container_linux.go:349: starting container process caused "exec: \"sh\": executable file not found in $PATH": unknown

docker exec -it 1cde9bea001d  bash
OCI runtime exec failed: exec failed: container_linux.go:349: starting container process caused "exec: \"bash\": executable file not found in $PATH": unknown

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
shurshur, 2020-08-21
@HexUserHex

ports:
      - 9001:9000

The port inside the container does not change.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question