wip: stalled changes

This commit is contained in:
Yann Autissier
2024-12-15 14:16:05 +01:00
parent d07a6aafaf
commit 65d739ee27
24 changed files with 393 additions and 17 deletions
+62
View File
@@ -0,0 +1,62 @@
# from: https://github.com/thorsten-l/389ds-docker-alpine
FROM --platform=$BUILDPLATFORM alpine:3.19 as builder
ARG TARGETPLATFORM
ARG BUILDPLATFORM
RUN echo "*** BUILDPLATFORM=$BUILDPLATFORM TARGETPLATFORM=$TARGETPLATFORM"
ARG BUILD_VERSION
ARG DOCKER_BUILD_DIR
RUN apk add build-base wget libtool autoconf automake openssl-dev cracklib-dev \
libevent-dev nspr-dev nss-dev openldap-dev db-dev icu-dev \
net-snmp-dev krb5-dev pcre-dev make rsync nss-tools openssl \
linux-pam-dev python3 py3-pip python3-dev git py3-setuptools \
py3-argcomplete py3-ldap3 py3-dateutil lmdb-dev json-c-dev pcre2-dev
RUN if [ "$TARGETPLATFORM" != "linux/arm/v7" ]; then apk add rust cargo ; fi
RUN mkdir /build
WORKDIR /build
RUN wget "https://github.com/389ds/389-ds-base/archive/refs/tags/389-ds-base-$BUILD_VERSION.tar.gz"
RUN tar xvfz "389-ds-base-$BUILD_VERSION.tar.gz"
WORKDIR "/build/389-ds-base-389-ds-base-$BUILD_VERSION"
RUN ./autogen.sh
RUN if [ "$TARGETPLATFORM" != "linux/arm/v7" ]; then ./configure --with-openldap --enable-rust ; fi
RUN if [ "$TARGETPLATFORM" == "linux/arm/v7" ]; then ./configure --with-openldap; fi
RUN sed -e 's/.*build_manpages.*/\tcd \$\(srcdir\)\/src\/lib389\; \$\(PYTHON\) setup.py build/g' Makefile > M
RUN mv M Makefile
COPY ${DOCKER_BUILD_DIR}/setup.py src/lib389/setup.py
RUN echo "@testing https://dl-cdn.alpinelinux.org/alpine/edge/testing" >> /etc/apk/repositories \
&& apk add zig@testing
RUN make -j 8 && make lib389 -j 8 && make install && make lib389-install
FROM alpine:3.19
RUN apk add openssl cracklib libevent nspr nss openldap db icu \
net-snmp krb5 pcre nss-tools openssl linux-pam python3 \
lmdb json-c pcre2 elfutils libffi libexpat
COPY --from=builder /opt /opt
COPY --from=builder /usr/sbin/ds* /usr/sbin/
COPY --from=builder /usr/lib/python3.10 /usr/lib/python3.10
COPY --from=builder /usr/libexec/dirsrv /usr/libexec/dirsrv
RUN mkdir -p /data /data/config /data/run /opt/dirsrv/var/run/dirsrv; \
ln -s /data/run /opt/dirsrv/var/run/dirsrv; \
ln -s /data/ssca /opt/dirsrv/etc/dirsrv/ssca; \
ln -s /data/config /opt/dirsrv/etc/dirsrv/slapd-localhost
HEALTHCHECK --start-period=5m --timeout=5s --interval=5s --retries=2 \
CMD /usr/libexec/dirsrv/dscontainer -H
WORKDIR /data
VOLUME /data
EXPOSE 3389 3636
CMD [ "/usr/libexec/dirsrv/dscontainer", "-r" ]
+86
View File
@@ -0,0 +1,86 @@
#!/usr/bin/python3
# --- BEGIN COPYRIGHT BLOCK ---
# Copyright (C) 2018 Red Hat, Inc.
# All rights reserved.
#
# License: GPL (version 3 or any later version).
# See LICENSE for details.
# --- END COPYRIGHT BLOCK ---
#
# A setup.py file
#
from setuptools import setup, find_packages
from os import path
from setuptools.command.build_py import build_py
here = path.abspath(path.dirname(__file__))
# fedora/rhel versioning or PEP440?; ATM semantic versioning
# with open(path.join(here, 'VERSION'), 'r') as version_file:
# version = version_file.read().strip()
version = "1.4.0.1"
with open(path.join(here, 'README.md'), 'r') as f:
long_description = f.read()
setup(
name='lib389',
license='GPLv3+',
version=version,
description='A library for accessing and configuring the 389 Directory ' +
'Server',
long_description=long_description,
url='http://www.port389.org/docs/389ds/FAQ/upstream-test-framework.html',
author='Red Hat Inc., and William Brown',
author_email='389-devel@lists.fedoraproject.org',
classifiers=[
'Development Status :: 4 - Beta',
'Intended Audience :: Developers',
'Operating System :: POSIX :: Linux',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.5',
'Programming Language :: Python :: 3.6',
'Programming Language :: Python :: 3.7',
'Topic :: Software Development :: Libraries',
'Topic :: Software Development :: Quality Assurance',
'Topic :: Software Development :: Testing'],
keywords='389 directory server test configure',
packages=find_packages(exclude=['tests*']),
# find lib389/clitools -name ds\* -exec echo \''{}'\', \;
data_files=[
('/usr/sbin/', [
'cli/dsctl',
'cli/dsconf',
'cli/dscreate',
'cli/dsidm',
'cli/openldap_to_ds',
]),
('/usr/libexec/dirsrv/', [
'cli/dscontainer',
]),
],
install_requires=[
'pyasn1',
'pyasn1-modules',
'python-dateutil',
'argcomplete',
'argparse-manpage',
'python-ldap',
'setuptools',
'distro',
],
cmdclass={
}
)
+4 -1
View File
@@ -1,4 +1,4 @@
ARG IPFS_VERSION=0.14.0
ARG IPFS_VERSION=0.24.0
FROM ipfs/kubo:v${IPFS_VERSION} as dist
LABEL maintainer aynic.os <support+docker@asycn.io>
ARG DOCKER_BUILD_DIR
@@ -7,6 +7,9 @@ RUN sed -i 's!repo="$IPFS_PATH"!repo="$IPFS_PATH" \&\& mkdir -p "$IPFS_PATH" \&\
COPY ${DOCKER_BUILD_DIR}/*.sh /container-init.d/
RUN chmod +rx /container-init.d/*.sh
HEALTHCHECK --interval=30s --timeout=3s --start-period=5s --retries=3 \
CMD ipfs --api=$(cat $IPFS_PATH/api) dag stat /ipfs/QmUNLLsPACCz1vLxQVkXqqLX5R1X345qqfHbsf67hvA3Nn || exit 1
FROM dist as master
ARG DOCKER_BUILD_DIR
ARG UID
+30
View File
@@ -0,0 +1,30 @@
# link: https://github.com/kvaps/docker-rozofs/blob/master/Dockerfile
FROM debian:bookworm as master
ARG DOCKER_BUILD_DIR
# Make sure the package repository is up to date and install required packages
RUN apt-get -y update \
&& apt-get install -fy gnupg lsb-release tini wget \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists
# Avoid warning during packet installations
ENV DEBIAN_FRONTEND noninteractive
# Install the release key
# Set the RozoFS repository to access RozoFS packages
# Install RozoFS manager (optionally) required for all nodes
RUN wget -O - http://dl.rozofs.org/deb/devel@rozofs.com.gpg.key | apt-key add - \
&& echo deb http://dl.rozofs.org/deb/master $(lsb_release -sc) main | tee /etc/apt/sources.list.d/rozofs.list \
&& echo 'APT::Install-Recommends "0";' > /etc/apt/apt.conf.d/01norecommend \
&& echo 'APT::Install-Suggests "0";' >> /etc/apt/apt.conf.d/01norecommend \
&& echo "#!/bin/sh\nexit 0" > /usr/sbin/policy-rc.d \
&& apt-get -y update \
&& apt-get install -y rozofs-manager* rozofs-* busybox inotify-tools \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists
COPY ${DOCKER_BUILD_DIR}/rozofs.sh /
ENTRYPOINT ["/usr/bin/tini", "--"]
CMD [ "/rozofs.sh" ]
+50
View File
@@ -0,0 +1,50 @@
#!/bin/bash
# link: https://github.com/kvaps/docker-rozofs/blob/master/rozofs.sh
start_daemons() {
# restore fstab
cp -f /etc/rozofs/fstab /etc/fstab
# start rozo agent
/etc/init.d/rozofs-manager-agent start
# start rozo export
if [ "$(grep -c '\(volumes\|exports\) *= *( *) *;' /etc/rozofs/export.conf)" != "2" ]; then
/etc/init.d/rozofs-exportd start
fi
# start rozo storage
if [ "$(grep -c 'storages *= *( *) *;' /etc/rozofs/storage.conf)" != "1" ]; then
/etc/init.d/rozofs-storaged start
fi
# start rozo mounts
awk '$1 == "rozofsmount" {print $2}' /etc/fstab |
while read mount; do
mkdir -p "$mount"
mount "$mount"
done
}
stop_daemons() {
# save fstab
cp -f /etc/fstab /etc/rozofs/fstab.bak
mv /etc/rozofs/fstab.bak /etc/rozofs/fstab
awk '$1 == "rozofsmount" {print $2}' /etc/fstab |
while read mount; do
umount "$mount"
done
/etc/init.d/rozofs-storaged stop
/etc/init.d/rozofs-exportd stop
/etc/init.d/rozofs-manager-agent stop
}
# start logging
/bin/busybox syslogd
tail -F /var/log/messages 2>/dev/null &
trap stop_daemons EXIT
start_daemons
while inotifywait -e modify /etc/fstab; do
cp -f /etc/fstab /etc/rozofs/fstab.bak
mv /etc/rozofs/fstab.bak /etc/rozofs/fstab
done &
wait $!