-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile-ubuntu
More file actions
54 lines (46 loc) · 2.78 KB
/
Dockerfile-ubuntu
File metadata and controls
54 lines (46 loc) · 2.78 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
FROM jelastic/ubuntuvps:16.04
ARG AUTOFS_VERSION=5.1.8
ARG AUTOFS_RELEASE=1ubuntu1
ARG AUTOFS_RELEASEJ=1
ARG MR_VERSION=1.2
RUN apt update && \
apt install -y apt-utils && \
apt install -y build-essential \
autoconf \
fakeroot \
dpkg-dev \
debhelper \
bison \
dpkg-dev \
e2fsprogs \
flex \
libhesiod-dev \
libkrb5-dev \
libldap-dev \
libsasl2-dev \
libssl-dev \
libxml2-dev \
pkg-config \
sssd-common
#ADD jelastic-autofs.patch /root/jelastic-autofs.patch
RUN mkdir -p /root/autofs && cd /root/autofs && \
wget https://launchpad.net/ubuntu/+archive/primary/+sourcefiles/autofs/$AUTOFS_VERSION-$AUTOFS_RELEASE/autofs_$AUTOFS_VERSION-$AUTOFS_RELEASE.dsc && \
wget https://launchpad.net/ubuntu/+archive/primary/+sourcefiles/autofs/$AUTOFS_VERSION-$AUTOFS_RELEASE/autofs_$AUTOFS_VERSION.orig.tar.xz && \
wget https://launchpad.net/ubuntu/+archive/primary/+sourcefiles/autofs/$AUTOFS_VERSION-$AUTOFS_RELEASE/autofs_$AUTOFS_VERSION-$AUTOFS_RELEASE.debian.tar.xz && \
dpkg-source -x autofs_$AUTOFS_VERSION-$AUTOFS_RELEASE.dsc && \
echo '9' > /root/autofs/autofs-$AUTOFS_VERSION/debian/compat && \
sed -i "s/$AUTOFS_VERSION-$AUTOFS_RELEASE/$AUTOFS_VERSION-${AUTOFS_RELEASEJ}j/" /root/autofs/autofs-$AUTOFS_VERSION/debian/changelog && \
mkdir -p /root/mount-recovery/mount-recovery_$MR_VERSION_amd64/DEBIAN && cd /root/mount-recovery/mount-recovery_$MR_VERSION_amd64 && \
mkdir -p usr/local/sbin lib/systemd/system etc/systemd/system/autofs.service.d
ADD rules /root/autofs/autofs-$AUTOFS_VERSION/debian/rules
ADD 50-mount-recovery.conf /root/mount-recovery/mount-recovery_${MR_VERSION}_amd64/etc/systemd/system/autofs.service.d/
ADD mount-recovery /root/mount-recovery/mount-recovery_${MR_VERSION}_amd64/usr/local/sbin/
ADD mount-recovery.service mount-recovery.timer /root/mount-recovery/mount-recovery_${MR_VERSION}_amd64/lib/systemd/system/
ADD mount-recovery-postinst /root/mount-recovery/mount-recovery_${MR_VERSION}_amd64/DEBIAN/postinst
ADD mount-recovery-control /root/mount-recovery/mount-recovery_${MR_VERSION}_amd64/DEBIAN/control
RUN chmod 755 /root/mount-recovery/mount-recovery_${MR_VERSION}_amd64/DEBIAN/postinst /root/mount-recovery/mount-recovery_${MR_VERSION}_amd64/usr/local/sbin/mount-recovery && \
sed -re '/Version:/s/Version: [\s0-9\.]{1,}/Version: ${MR_VERSION}/' /root/mount-recovery/mount-recovery_${MR_VERSION}_amd64/DEBIAN/control
RUN echo "cd /root/autofs/autofs-$AUTOFS_VERSION/ && sed -i '/Rules-Requires-Root/d' debian/control && dpkg-buildpackage -rfakeroot -b -d && cd ../ && cp -f *.deb /mnt" > /run.sh && \
echo "cd /root/mount-recovery/ && dpkg-deb --build mount-recovery_${MR_VERSION}_amd64 && cp -f *.deb /mnt" >> /run.sh
CMD bash /run.sh
#docker run -v /home/dmytro/autofs/deb:/mnt test/test