Skip to content

Commit c333630

Browse files
committed
build: add debian server build
this triggers the debian based server build: make KIND=server OS_NAME=debian build-image Signed-off-by: Michael Adam <[email protected]>
1 parent bd28817 commit c333630

File tree

3 files changed

+69
-1
lines changed

3 files changed

+69
-1
lines changed

hack/build-image

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,10 +89,12 @@ ARCHITECTURES = {
8989
FEDORA = "fedora"
9090
CENTOS = "centos"
9191
OPENSUSE = "opensuse"
92+
DEBIAN = "debian"
9293
DISTROS = [
9394
FEDORA,
9495
CENTOS,
9596
OPENSUSE,
97+
DEBIAN,
9698
]
9799

98100
# PACKAGE_SOURCES - list of known package sources

images/common/install-sambacc-common.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ install_sambacc() {
7373

7474
case $action in
7575
install-wheel)
76-
pip install "${wheels[0]}"
76+
pip install --break-system-packages "${wheels[0]}"
7777
container_json_file="/usr/local/share/sambacc/examples/${DEFAULT_JSON_FILE}"
7878
;;
7979
install-rpm)

images/server/Containerfile.debian

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
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

Comments
 (0)