Skip to content

Commit

Permalink
build: add debian server build
Browse files Browse the repository at this point in the history
this triggers the debian based server build:

make KIND=server OS_NAME=debian build-image

Signed-off-by: Michael Adam <[email protected]>
  • Loading branch information
obnoxxx committed Jan 9, 2025
1 parent a32f9cd commit ef45ee2
Show file tree
Hide file tree
Showing 3 changed files with 69 additions and 1 deletion.
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 @@ -70,7 +70,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:

0 comments on commit ef45ee2

Please sign in to comment.