Browse Source

Issue 50439 - Update docker integration for Fedora

Bug Description:
Fedora Dockerfile has been unbuildable/broken for sometime.

Fix Description:
Update the Dockerfile to make it work while mimicking ideas from the
SUSE's counterpart.

Additionaly, changing wget to curl in rpm.mk since wget does not seem to
be available in the minimal image.

Relates https://pagure.io/389-ds-base/issue/50439
Relates https://pagure.io/389-ds-base/pull-request/50441#comment-88961

Author: Matus Honek <mhonek@redhat.com>

Review by: firstyear, vashirov (thanks!)
tags/debian/1.4.3.2-1
Matus Honek 1 year ago
parent
commit
957e2ae225
3 changed files with 38 additions and 30 deletions
  1. +3
    -0
      docker.mk
  2. +34
    -29
      docker/389-ds-fedora/Dockerfile
  3. +1
    -1
      rpm.mk

+ 3
- 0
docker.mk View File

@@ -1,3 +1,6 @@

suse:
docker build -t 389-ds-suse:master -f docker/389-ds-suse/Dockerfile .

fedora:
docker build -t 389-ds-fedora:master -f docker/389-ds-fedora/Dockerfile .

+ 34
- 29
docker/389-ds-fedora/Dockerfile View File

@@ -6,41 +6,46 @@
# See LICENSE for details.
# --- END COPYRIGHT BLOCK ---

FROM fedora:26
FROM fedora:latest
MAINTAINER 389-devel@lists.fedoraproject.org
EXPOSE 389 636
ENV container docker

RUN mkdir -p /usr/local/src
WORKDIR /usr/local/src
EXPOSE 3389 3636

ADD ./ /usr/local/src/389-ds-base

RUN dnf upgrade -y && \
dnf install --setopt=strict=False -y \
@buildsys-build rpm-build make bzip2 git rsync \
`grep -E "^(Build)?Requires" 389-ds-base/rpm/389-ds-base.spec.in | grep -v -E '(name|MODULE)' | awk '{ print $2 }' | sed 's/%{python3_pkgversion}/3/g' | grep -v "^/" | grep -v pkgversion | sort | uniq | tr '\n' ' '` && \
WORKDIR /usr/local/src/389-ds-base

# install dependencies
RUN dnf upgrade -y \
&& dnf install --setopt=strict=False -y @buildsys-build rpm-build make bzip2 git rsync \
`grep -E "^(Build)?Requires" rpm/389-ds-base.spec.in \
| grep -v -E '(name|MODULE)' \
| awk '{ print $2 }' \
| sed 's/%{python3_pkgversion}/3/g' \
| grep -v "^/" \
| grep -v pkgversion \
| sort | uniq \
| tr '\n' ' '` \
&& dnf clean all

# build
RUN make -f rpm.mk rpms || sh -c 'echo "build failed, sleeping for some time to allow you debug" ; sleep 3600'

RUN dnf install -y dist/rpms/*389*.rpm && \
dnf clean all

# Link some known static locations to point to /data
RUN mkdir -p /data/config && \
mkdir -p /data/ssca && \
mkdir -p /data/run && \
mkdir -p /var/run/dirsrv && \
ln -s /data/config /etc/dirsrv/slapd-localhost && \
ln -s /data/ssca /etc/dirsrv/ssca && \
ln -s /data/run /var/run/dirsrv

### CHANGE THIS TO A ./configure and build that way.

RUN cd 389-ds-base && \
PERL_ON=0 RUST_ON=1 make -f rpm.mk rpms

RUN dnf install -y 389-ds-base/dist/rpms/*389*.rpm && \
dnf clean all

# Create the example setup inf. It's valid for containers!
# Build the instance from the new installer tools.
RUN /usr/sbin/dscreate create-template > /root/ds-setup.inf && /usr/sbin/dscreate -v from-file /root/ds-setup.inf --containerised
VOLUME /data

# Finally add the volumes, they will inherit the contents of these directories.
VOLUME /etc/dirsrv
VOLUME /var/log/dirsrv
VOLUME /var/lib/dirsrv
#USER dirsrv

# Or, run them as dirsrv
USER dirsrv
CMD ["/usr/sbin/ns-slapd", "-d", "0", "-D", "/etc/dirsrv/slapd-localhost", "-i", "/var/run/dirsrv/slapd-localhost.pid"]
HEALTHCHECK --start-period=5m --timeout=5s --interval=5s --retries=2 \
CMD /usr/sbin/dscontainer -H

CMD [ "/usr/sbin/dscontainer", "-r" ]

+ 1
- 1
rpm.mk View File

@@ -78,7 +78,7 @@ tarballs: local-archive
rm -rf dist/$(NAME_VERSION)
cd dist/sources ; \
if [ $(BUNDLE_JEMALLOC) -eq 1 ]; then \
wget $(JEMALLOC_URL) ; \
curl -LO $(JEMALLOC_URL) ; \
fi

rpmroot:


Loading…
Cancel
Save