Overriding entrypoint still starts /usr/bin/s6-svscan /service

Hi,

I’m trying to override the entrypoint and command for the rancher/server inside docker-compose to be able to pass the container IP to the --advertise-address argument.

version: "3"
services:
  # Rancher server
  server:
    image: rancher/server:stable
    environment:
      - CATTLE_DB_CATTLE_DATABASE=mysql
      - CATTLE_DB_CATTLE_MYSQL_HOST=db
      - CATTLE_DB_CATTLE_MYSQL_NAME=cattle
      - CATTLE_DB_CATTLE_MYSQL_PORT=3306
      - CATTLE_DB_CATTLE_USERNAME=cattle
      - CATTLE_DB_CATTLE_PASSWORD=cattle
    ports:
      - "8080:8080"
      - "9345:9345"
    volumes:
      - /mnt/resources/docker/rancher/entrypoint.sh:/entrypoint.sh
      - /var/run/docker.sock:/var/run/docker.sock
    deploy:
      replicas: 2
      restart_policy:
        condition: on-failure
        delay: 5s
        max_attempts: 3
    depends_on:
      - db
    networks:
      - net
    entrypoint: /entrypoint.sh
  db:
    image: mysql:5.7.20
    environment:
      MYSQL_ROOT_PASSWORD: s3cr3t!
      MYSQL_DATABASE: cattle
      MYSQL_USER: cattle
      MYSQL_PASSWORD: cattle
    ports:
      - "3306:3306"
    volumes:
      - /mnt/resources/docker/rancher/mysql:/var/lib/mysql
    deploy:
      replicas: 1
      restart_policy:
        condition: on-failure
        delay: 5s
        max_attempts: 3
    networks:
      - net
networks:
  net:
    driver: overlay
    ipam:
      driver: default
      config:
        - subnet: 172.99.99.0/16

and the entrypoint.sh:
#!/bin/bash

set -x
CATTLE_CLUSTER_ADVERTISE_ADDRESS=$(getent hosts ${HOSTNAME} | awk '{ print $1 }')

/usr/bin/entry --db-host ${CATTLE_DB_CATTLE_MYSQL_HOST} --db-port ${CATTLE_DB_CATTLE_MYSQL_PORT} --db-name ${CATTLE_DB_CATTLE_MYSQL_NAME} --db-user ${CATTLE_DB_CATTLE_USERNAME} --db-pass ${CATTLE_DB_CATTLE_PASSWORD} --advertise-address ${CATTLE_CLUSTER_ADVERTISE_ADDRESS}

The difference between running this method vs manually is that I have these extra processes:
/usr/bin/s6-svscan /service
s6-supervise cattle
s6-supervise graphite_exporter
s6-supervise mysql

It’s like the Dockerfile CMD it’s still executed…

Any idea why?

ok…
So it’s executed from /usb/bin/entry

if [ "$#" = 0 ]; then
exec /usr/bin/s6-svscan /service
fi

Now I need to understand why… :stuck_out_tongue:

The problem here is my stupidity :roll_eyes::rofl:
Sorry about that…

What happened? What did you find out?