docker-compose.yml через массив пошло не так, а без параметров.
image: registry:2.7.0
entrypoint: ["sh", "-c", "-x", "htpasswd", "-Bbn", "admin", "87052269316"]
docker-compose up
Creating network "test_httpass_default" with the default driver
Creating test_httpass_passwd_1 ... done
Attaching to test_httpass_passwd_1
passwd_1 | + htpasswd
passwd_1 | Usage:
passwd_1 | htpasswd [-cimBdpsDv] [-C cost] passwordfile username
..................................................
test_httpass_passwd_1 exited with code 2
Все параметры съело
image: registry:2.7.0
entrypoint: ["sh", "-c", "-x", "htpasswd -Bbn admin 87052269316"]
docker-compose up
Creating network "test_httpass_default" with the default driver
Creating test_httpass_passwd_1 ... done
Attaching to test_httpass_passwd_1
passwd_1 | + htpasswd -Bbn admin 87052269316
passwd_1 | admin:$2y$05$8ez4zkcdkxJoYBZ32PkBwuYiojfeGHO106cty3m65DcHe/t9Yxzmm
passwd_1 |
test_httpass_passwd_1 exited with code 0
Вроде всё Ок, должно быть в первом варианте, но нет, что не так?
https://docs.docker.com/compose/compose-file/compose-file-v3/
If the -c option is present, then commands are read from string. If there are arguments after the string, they are assigned to the positional parameters, starting with $0.
Спасибо, image: registry:2.7.0 entrypoint: ["htpasswd", "-Bbn", "admin", "87052269316"] Заработало, видать, что-то не так ещё делал, до того как дебажить начал.
Обсуждают сегодня