Dex configuration missing `serve`

Hi, I'm trying to follow the auth with dex path. After launching dex there are 0 replicas and sudo docker service logs dex_dex gives the following in the log
| error: cannot lookup path for command serve: exec: "serve": executable file not found in $PATH
| error: cannot lookup path for command serve: exec: "serve": executable file not found in $PATH
3 Replies
tomche
tomche9mo ago
Ok, I htink I've managed to fix it 🤔
version: '3'

services:
dex:
image: dexidp/dex
volumes:
- /etc/localtime:/etc/localtime:ro
- /var/data/config/dex/config.yml:/config.yml:ro
networks:
- traefik_public
# FIX
command: ['dex', 'serve', '/config.yml']
deploy:
labels:
- "traefik.enable=true"
- "traefik.docker.network=traefik_public"
- "traefik.http.routers.dex.rule=Host(`dex.frdr.cc`)"
- "traefik.http.routers.dex.enrypoints=https"
- "traefik.http.services.dex.loadbalancer.server.port=5556"

networks:
traefik_public:
external: true
version: '3'

services:
dex:
image: dexidp/dex
volumes:
- /etc/localtime:/etc/localtime:ro
- /var/data/config/dex/config.yml:/config.yml:ro
networks:
- traefik_public
# FIX
command: ['dex', 'serve', '/config.yml']
deploy:
labels:
- "traefik.enable=true"
- "traefik.docker.network=traefik_public"
- "traefik.http.routers.dex.rule=Host(`dex.frdr.cc`)"
- "traefik.http.routers.dex.enrypoints=https"
- "traefik.http.services.dex.loadbalancer.server.port=5556"

networks:
traefik_public:
external: true
While this fixes the first problem there seems to be issues with sqlite permissions/setup as well
funkypenguin | ElfHosted
do we need the dex in front of the command? i.e., this (used to) work:
command: ['serve','/config.yml']
command: ['serve','/config.yml']
huh. you're right, they must have changed the image, this no longer works:
❯ docker run --rm -it dexidp/dex serve 07:44:49
Unable to find image 'dexidp/dex:latest' locally
latest: Pulling from dexidp/dex
c30352492317: Already exists
0872ee88cf88: Pull complete
945f33486c8f: Pull complete
4d81366d627a: Pull complete
37f44c270703: Pull complete
8b5e09a0dfbe: Pull complete
ef3baa5888fe: Pull complete
cb924b4d184b: Pull complete
d7205501dbbd: Pull complete
ec8d99199e57: Pull complete
Digest: sha256:e9e5366270f7990cf390c086040dfb4ea44846dda21ef40741c116eb78d14ed4
Status: Downloaded newer image for dexidp/dex:latest
error: cannot lookup path for command serve: exec: "serve": executable file not found in $PATH
❯ docker run --rm -it dexidp/dex serve 07:44:49
Unable to find image 'dexidp/dex:latest' locally
latest: Pulling from dexidp/dex
c30352492317: Already exists
0872ee88cf88: Pull complete
945f33486c8f: Pull complete
4d81366d627a: Pull complete
37f44c270703: Pull complete
8b5e09a0dfbe: Pull complete
ef3baa5888fe: Pull complete
cb924b4d184b: Pull complete
d7205501dbbd: Pull complete
ec8d99199e57: Pull complete
Digest: sha256:e9e5366270f7990cf390c086040dfb4ea44846dda21ef40741c116eb78d14ed4
Status: Downloaded newer image for dexidp/dex:latest
error: cannot lookup path for command serve: exec: "serve": executable file not found in $PATH
thanks for the PR 🙂 what's the permissions issue?
tomche
tomche9mo ago
Had 2 issues which were complaining about permissions/missing files. Essentially fixed with these
sudo touch /var/data/config/traefik-forward-auth/config.ini
sudo chmod 644 /var/data/config/traefik-forward-auth/config.ini
sudo mkdir /var/data/dex
sudo touch /var/data/dex/dex.db
sudo chmod 644 /var/data/dex/dex.db
sudo touch /var/data/config/traefik-forward-auth/config.ini
sudo chmod 644 /var/data/config/traefik-forward-auth/config.ini
sudo mkdir /var/data/dex
sudo touch /var/data/dex/dex.db
sudo chmod 644 /var/data/dex/dex.db
So sqlite db for dex and config.ini for forward auth. Dunno if it;s the best solution 😉 But it works on my machine ™️
Want results from more Discord servers?
Add your server