Initial commit

This commit is contained in:
Joe Biellik 2016-05-17 16:24:51 +01:00
commit acc75afb87
4 changed files with 55 additions and 0 deletions

13
.editorconfig Normal file
View file

@ -0,0 +1,13 @@
root = true
[*]
charset = utf-8
indent_style = tab
indent_size = 4
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true
[{README.md}]
indent_style = space
indent_size = 2

2
.gitattributes vendored Normal file
View file

@ -0,0 +1,2 @@
* text=auto
* text eol=lf

32
Dockerfile Normal file
View file

@ -0,0 +1,32 @@
FROM alpine:latest
ENV UID 1000
ENV USERNAME samba
ENV GID 1000
ENV GROUP samba
ENV PASSWORD password
RUN set -xe \
&& apk add --update --no-progress samba-common-tools samba-server openssl \
&& rm -rf /var/cache/apk/*
ENV S6_VERSION 1.17.2.0
RUN set -xe \
&& cd /tmp \
&& wget https://github.com/just-containers/s6-overlay/releases/download/v$S6_VERSION/s6-overlay-amd64.tar.gz \
&& wget https://github.com/just-containers/s6-overlay/releases/download/v$S6_VERSION/s6-overlay-amd64.tar.gz.sig \
&& apk add --update --no-progress --virtual gpg gnupg \
&& gpg --keyserver pgp.mit.edu --recv-key 0x337EE704693C17EF \
&& gpg --verify /tmp/s6-overlay-amd64.tar.gz.sig /tmp/s6-overlay-amd64.tar.gz \
&& tar xzf s6-overlay-amd64.tar.gz -C / \
&& apk del gpg \
&& rm -rf /tmp/s6-overlay-amd64.tar.gz /tmp/s6-overlay-amd64.tar.gz.sig /root/.gnupg /var/cache/apk/*
COPY samba.s6 /etc/services.d/samba/run
RUN mkdir /config
VOLUME ["/config"]
EXPOSE 137/udp 138/udp 139/tcp 445/tcp
CMD ["/init"]

8
samba.s6 Normal file
View file

@ -0,0 +1,8 @@
#!/usr/bin/with-contenv sh
addgroup -g ${GID} ${GROUP}
adduser -S -G ${GROUP} -u ${UID} -H -D ${USERNAME}
echo "${PASSWORD}" | tee - | smbpasswd -s -c /config/smb.conf -a ${USERNAME}
nmbd --foreground --log-stdout --configfile=/config/smb.conf &
smbd --foreground --log-stdout --configfile=/config/smb.conf