Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build: Add debian based server image build #193

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions hack/build-image
Original file line number Diff line number Diff line change
Expand Up @@ -89,10 +89,12 @@ ARCHITECTURES = {
FEDORA = "fedora"
CENTOS = "centos"
OPENSUSE = "opensuse"
DEBIAN = "debian"
DISTROS = [
FEDORA,
CENTOS,
OPENSUSE,
DEBIAN,
]

# PACKAGE_SOURCES - list of known package sources
Expand Down
2 changes: 1 addition & 1 deletion images/common/install-sambacc-common.sh
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ install_sambacc() {

case $action in
install-wheel)
pip install "${wheels[0]}"
pip install --break-system-packages "${wheels[0]}"
container_json_file="/usr/local/share/sambacc/examples/${DEFAULT_JSON_FILE}"
;;
install-rpm)
Expand Down
66 changes: 66 additions & 0 deletions images/server/Containerfile.debian
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
FROM quay.io/samba.org/sambacc:latest AS sccbuilder

ARG SAMBACC_VER=master
ARG SAMBACC_DISTNAME=latest
ARG SAMBACC_REPO=https://github.com/samba-in-kubernetes/sambacc
RUN SAMBACC_DISTNAME=${SAMBACC_DISTNAME} \
/usr/local/bin/build.sh ${SAMBACC_VER} ${SAMBACC_REPO}

FROM docker.io/library/debian
ARG INSTALL_PACKAGES_FROM=default
ARG SAMBA_VERSION_SUFFIX=""
ARG SAMBACC_VERSION_SUFFIX="${SAMBACC_DISTNAME}"
ARG SAMBACC_DIST_DIR_HOST="sambacc-dist/latest"
ARG SAMBACC_DIST_DIR="/tmp/sambacc-dist-latest"
ARG SAMBA_SPECIFICS=daemon_cli_debug_output,ctdb_leader_admin_command
ARG INSTALL_CUSTOM_REPO=
ARG PACKAGE_SELECTION=

MAINTAINER Michael Adam <[email protected]>

LABEL org.opencontainers.image.title="Samba container"
LABEL org.opencontainers.image.description="Samba container"
LABEL org.opencontainers.image.vendor="Samba in Kubernetes"
LABEL org.opencontainers.image.url="https://github.com/samba-in-kubernetes/samba-container"

COPY smb.conf /etc/samba/smb.conf
RUN apt-get update
RUN apt-get upgrade --yes
RUN apt-get install --yes \
findutils \
python3-full \
python3-pip \
python3-jsonschema \
python3-pyxattr \
samba \
winbind \
ctdb \
samba-vfs-modules

# If you want to install a custom version of sambacc into this image mount
# a directory containing a sambacc RPM, or a sambacc wheel, or a .repo
# file at /tmp/sambacc-dist-latest
# If the directory is empty the script automatically falls back to using
# the latest continuously built RPM from our sambacc COPR:
# https://copr.fedorainfracloud.org/coprs/phlogistonjohn/sambacc
RUN mkdir -p ${SAMBACC_DIST_DIR}
COPY ${SAMBACC_DIST_DIR_HOST} $SAMBACC_DIST_DIR}
COPY .common/install-sambacc-common.sh /usr/local/bin/install-sambacc-common.sh
COPY install-sambacc.sh /usr/local/bin/install-sambacc.sh
RUN --mount=type=bind,from=sccbuilder,source=/srv/dist/latest,destination=/tmp/sambacc-dist-latest bash -x /usr/local/bin/install-sambacc.sh \
"${SAMBACC_DIST_DIR}" \
"${SAMBACC_VERSION_SUFFIX}"


VOLUME ["/share"]

EXPOSE 445

ENV SAMBACC_CONFIG="/etc/samba/container.json:/etc/samba/users.json"
ENV SAMBA_CONTAINER_ID="demo"
ENV SAMBA_SPECIFICS="$SAMBA_SPECIFICS"
ENV SAMBACC_DIST_DIR="$SAMBACC_DIST_DIR"
ENTRYPOINT ["samba-container"]
CMD ["run", "smbd"]

# vim:set syntax=dockerfile:
Loading