我用alpine,s6和samba构建了一个docker容器。
一切看起来都很好,但是当启动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

Dockerfile:
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"]

最佳答案

在smbd中添加--no-process-group标志。

关于Docker Alpine Samba无法启动,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/49357524/

10-16 15:54