|
| 1 | +FROM quay.io/samba.org/sambacc:latest AS sccbuilder |
| 2 | + |
| 3 | +ARG SAMBACC_VER=master |
| 4 | +ARG SAMBACC_DISTNAME=latest |
| 5 | +ARG SAMBACC_REPO=https://github.com/samba-in-kubernetes/sambacc |
| 6 | +RUN SAMBACC_DISTNAME=${SAMBACC_DISTNAME} \ |
| 7 | +/usr/local/bin/build.sh ${SAMBACC_VER} ${SAMBACC_REPO} |
| 8 | + |
| 9 | +FROM docker.io/library/debian |
| 10 | +ARG INSTALL_PACKAGES_FROM=default |
| 11 | +ARG SAMBA_VERSION_SUFFIX="" |
| 12 | +ARG SAMBACC_VERSION_SUFFIX="${SAMBACC_DISTNAME}" |
| 13 | +ARG SAMBACC_DIST_DIR_HOST="sambacc-dist/latest" |
| 14 | +ARG SAMBACC_DIST_DIR="/tmp/sambacc-dist-latest" |
| 15 | +ARG SAMBA_SPECIFICS=daemon_cli_debug_output,ctdb_leader_admin_command |
| 16 | +ARG INSTALL_CUSTOM_REPO= |
| 17 | +ARG PACKAGE_SELECTION= |
| 18 | + |
| 19 | +MAINTAINER Michael Adam < [email protected]> |
| 20 | + |
| 21 | +LABEL org.opencontainers.image.title="Samba container" |
| 22 | +LABEL org.opencontainers.image.description="Samba container" |
| 23 | +LABEL org.opencontainers.image.vendor="Samba in Kubernetes" |
| 24 | +LABEL org.opencontainers.image.url="https://github.com/samba-in-kubernetes/samba-container" |
| 25 | + |
| 26 | +COPY smb.conf /etc/samba/smb.conf |
| 27 | +RUN apt-get update |
| 28 | +RUN apt-get upgrade --yes |
| 29 | +RUN apt-get install --yes \ |
| 30 | + findutils \ |
| 31 | + python3-full \ |
| 32 | + python3-pip \ |
| 33 | + python3-jsonschema \ |
| 34 | + python3-pyxattr \ |
| 35 | + samba \ |
| 36 | + winbind \ |
| 37 | + ctdb \ |
| 38 | + samba-vfs-modules |
| 39 | + |
| 40 | +# If you want to install a custom version of sambacc into this image mount |
| 41 | +# a directory containing a sambacc RPM, or a sambacc wheel, or a .repo |
| 42 | +# file at /tmp/sambacc-dist-latest |
| 43 | +# If the directory is empty the script automatically falls back to using |
| 44 | +# the latest continuously built RPM from our sambacc COPR: |
| 45 | +# https://copr.fedorainfracloud.org/coprs/phlogistonjohn/sambacc |
| 46 | +RUN mkdir -p ${SAMBACC_DIST_DIR} |
| 47 | +COPY ${SAMBACC_DIST_DIR_HOST} $SAMBACC_DIST_DIR} |
| 48 | +COPY .common/install-sambacc-common.sh /usr/local/bin/install-sambacc-common.sh |
| 49 | +COPY install-sambacc.sh /usr/local/bin/install-sambacc.sh |
| 50 | +RUN --mount=type=bind,from=sccbuilder,source=/srv/dist/latest,destination=/tmp/sambacc-dist-latest bash -x /usr/local/bin/install-sambacc.sh \ |
| 51 | + "${SAMBACC_DIST_DIR}" \ |
| 52 | + "${SAMBACC_VERSION_SUFFIX}" |
| 53 | + |
| 54 | + |
| 55 | +VOLUME ["/share"] |
| 56 | + |
| 57 | +EXPOSE 445 |
| 58 | + |
| 59 | +ENV SAMBACC_CONFIG="/etc/samba/container.json:/etc/samba/users.json" |
| 60 | +ENV SAMBA_CONTAINER_ID="demo" |
| 61 | +ENV SAMBA_SPECIFICS="$SAMBA_SPECIFICS" |
| 62 | +ENV SAMBACC_DIST_DIR="$SAMBACC_DIST_DIR" |
| 63 | +ENTRYPOINT ["samba-container"] |
| 64 | +CMD ["run", "smbd"] |
| 65 | + |
| 66 | +# vim:set syntax=dockerfile: |
0 commit comments