I use this image: dperson/samba
The image is defining it\'s own entrypoint and I do not want to override it.
I need to pass arguments to the entrypoint, easy
To override the default entrypoint, use entrypoint option. To pass the arguments use command.
Here is the example of replacing bash with sh in ubuntu image:
version: '3'
services:
sh:
entrypoint: /bin/sh
command: -c "ps $$(echo $$$$)"
image: ubuntu
tty: true
bash:
entrypoint: /bin/bash
command: -c "ps $$(echo $$$$)"
image: ubuntu
tty: true
Here is the output:
$ docker-compose up
Starting test_sh_1 ... done
Starting 020211508a29_test_bash_1 ... done
Attaching to test_sh_1, 020211508a29_test_bash_1
sh_1 | PID TTY STAT TIME COMMAND
sh_1 | 1 pts/0 Ss+ 0:00 /bin/sh -c ps $(echo $$)
020211508a29_test_bash_1 | PID TTY STAT TIME COMMAND
020211508a29_test_bash_1 | 1 pts/0 Rs+ 0:00 ps 1