【问题标题】:Docker Alpine Samba does not startDocker Alpine Samba 无法启动
【发布时间】:2018-08-27 16:36:20
【问题描述】:

我用 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"]

【问题讨论】:

    标签: docker samba alpine


    【解决方案1】:

    将--no-process-group 标志添加到 smbd。

    【讨论】:

    【解决方案2】:

    由于您没有分享您的配置,但我建议您从此存储库构建您自己的 docker 映像。我在当地很累,而且工作正常。 这是 Docker 文件

    FROM alpine:latest
    MAINTAINER Peter Winter <peter@pwntr.com>
    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

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2021-11-12
      • 1970-01-01
      • 2023-03-14
      • 2018-06-22
      • 1970-01-01
      • 2015-01-24
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多