Docker Alpine Samba не запускается

Я создаю докер-контейнер с помощью alpine, s6 и samba. Все выглядит нормально, но когда он запускает smbd, он вылетает прямо перед запуском без каких-либо файлов журналов.

added interface eth0 ip=172.17.0.6 bcast=172.17.255.255       
netmask=255.255.0.0
loaded services    
Netbios name list:-
my_netbios_names[0]="ADD372A5C9D7"
INFO: Profiling support unavailable in this build.
Standard input is not a socket, assuming -D option
Becoming a daemon.
exit_daemon: STATUS=daemon failed to start: Failed to create session, error code 1

служба запуска s6:

#!/usr/bin/execlineb -P
smbd --foreground --log-stdout

Докерфайл:

FROM alpine:edge

# env variables
ENV S6_VERSION v1.21.2.1

# install s6-overlay
ADD https://github.com/just-containers/s6-overlay/releases/download/${S6_VERSION}/s6-overlay-amd64.tar.gz /tmp/
RUN tar xzf /tmp/s6-overlay-amd64.tar.gz -C /

RUN apk add --no-cache \
    bash shadow \
    samba-common-tools \
    samba-client \
    samba-server \
    && rm -rf /var/cache/apk/*

# add local files
COPY root/ /

EXPOSE 445/tcp

CMD ["/init"]

person Mav    schedule 19.03.2018    source источник


Ответы (2)


Добавьте флаг --no-process-group в smbd.

person H.G.Blob    schedule 14.05.2018
comment
Добро пожаловать в Stack Overflow, ознакомьтесь с: stackoverflow.com/help/how-to-answer. - person Daniel; 14.05.2018
comment
Это сработало для меня. Тем не менее, я хотел бы увидеть объяснение того, что это значит. - person joonas.fi; 14.08.2019

Поскольку вы не делились своей конфигурацией, я рекомендую создать собственный образ докера из этого репозитория. Я устал локально, и он работает нормально. Вот файл докера

FROM alpine:latest
MAINTAINER Peter Winter <[email protected]>
LABEL Description="Simple and lightweight Samba docker container, based on Alpine Linux." Version="0.1"

# update the base system
RUN apk update && apk upgrade

# install samba and supervisord and clear the cache afterwards
RUN apk add samba samba-common-tools supervisor && rm -rf /var/cache/apk/*

# create a dir for the config and the share
RUN mkdir /config /shared

# copy config files from project folder to get a default config going for samba and supervisord
COPY *.conf /config/

# add a non-root user and group called "rio" with no password, no home dir, no shell, and gid/uid set to 1000
RUN addgroup -g 1000 rio && adduser -D -H -G rio -s /bin/false -u 1000 rio

# create a samba user matching our user from above with a very simple password ("letsdance")
RUN echo -e "letsdance\nletsdance" | smbpasswd -a -s -c /config/smb.conf rio

# volume mappings
VOLUME /config /shared

# exposes samba's default ports (137, 138 for nmbd and 139, 445 for smbd)
EXPOSE 137/udp 138/udp 139 445

ENTRYPOINT ["supervisord", "-c", "/config/supervisord.conf"]

Для samba.conf и других настроек вы можете проверить

samba-alpine-docker

введите здесь описание изображения

person Adiii    schedule 20.03.2018