-
Notifications
You must be signed in to change notification settings - Fork 79
/
Dockerfile.localbuild
98 lines (93 loc) · 3.87 KB
/
Dockerfile.localbuild
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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
FROM ubuntu:20.04 as base
ARG DEBIAN_FRONTEND=noninteractive
LABEL [email protected]
LABEL author="Sam Silverberg"
RUN DEBIAN_FRONTEND="noninteractive" apt update && DEBIAN_FRONTEND="noninteractive" apt upgrade -y && DEBIAN_FRONTEND="noninteractive" apt install -y \
openjdk-11-jdk \
maven \
libfuse2 \
ssh \
openssh-server \
jsvc \
libxml2 \
ruby-dev \
build-essential \
libxml2-utils \
fuse \
alien \
git
RUN gem install fpm
COPY .git /sdfs-build/
COPY pom.xml /sdfs-build/
WORKDIR "/sdfs-build"
ENV VERSION=master
ENV JAVA_HOME=/usr/lib/jvm/java-11-openjdk-amd64/
WORKDIR "/sdfs-build/"
RUN mvn dependency:copy-dependencies
ENTRYPOINT ls -lah
FROM base AS builder
ARG DEBIAN_FRONTEND=noninteractive
LABEL [email protected]
LABEL author="Sam Silverberg"
ENV VERSION=master
COPY pom.xml /sdfs-build/
COPY src /sdfs-build/src/
COPY .git /sdfs-build/.git
COPY install-packages /sdfs-build/install-packages/
WORKDIR "/sdfs-build"
RUN DEBIAN_FRONTEND="noninteractive" apt update && DEBIAN_FRONTEND="noninteractive" apt upgrade -y && DEBIAN_FRONTEND="noninteractive" apt install -y \
git
RUN wget https://cdn.azul.com/zulu/bin/zulu11.35.13-ca-jdk11.0.5-linux_x64.tar.gz && \
rm -rf install-packages/deb/usr/share/sdfs/bin/jre && \
tar -xzvf zulu11.35.13-ca-jdk11.0.5-linux_x64.tar.gz && \
mkdir -p install-packages/deb/usr/share/sdfs/bin/ && \
cp -rf zulu11.35.13-ca-jdk11.0.5-linux_x64 install-packages/deb/usr/share/sdfs/bin/jre
ENV VERSION=master
ENV PKG_VERSION=0.0.1
ENV JAVA_HOME=/usr/lib/jvm/java-11-openjdk-amd64/
ENV DEBFILE="sdfs_${PKG_VERSION}_amd64.deb"
RUN echo $DEBFILE
WORKDIR "/sdfs-build/install-packages/"
RUN rm -rf deb/usr/share/sdfs/lib/*
WORKDIR "/sdfs-build/"
RUN mvn package
RUN cp target/lib/*.jar install-packages/deb/usr/share/sdfs/lib/ && \
cp target/sdfs-${VERSION}.jar install-packages/deb/usr/share/sdfs/lib/sdfs.jar && \
cp target/sdfs-${VERSION}.jar install-packages
WORKDIR "/sdfs-build/install-packages/"
RUN rm -rf *.deb *.rpm && \
cp ../src/readme.txt deb/usr/share/sdfs/ && \
fpm -s dir -t deb -n sdfs -v $PKG_VERSION -C deb/ -d fuse --url http://www.opendedup.org -d libxml2 -d libxml2-utils -m [email protected] --vendor datishsystems --description "SDFS is an inline deduplication based filesystem" && \
fpm -s dir -t rpm -n sdfs -v $PKG_VERSION -C deb/ -d fuse --url http://www.opendedup.org -d libxml2 -m [email protected] --vendor datishsystems --description "SDFS is an inline deduplication based filesystem"
WORKDIR "/sdfs-build/install-packages/"
RUN echo "tar cvf - sdfs-${VERSION}-jar-with-dependencies.jar sdfs_${PKG_VERSION}_amd64.deb sdfs-${PKG_VERSION}-1.x86_64.rpm" > export_data.sh && \
chmod 700 export_data.sh
ENTRYPOINT tar cvf - sdfs-${VERSION}.jar sdfs_${PKG_VERSION}_amd64.deb sdfs-${PKG_VERSION}-1.x86_64.rpm
FROM ubuntu:20.04
ENV VERSION=master
ENV PKG_VERSION=0.0.1
LABEL [email protected]
LABEL author="Sam Silverberg"
RUN DEBIAN_FRONTEND="noninteractive" apt update && DEBIAN_FRONTEND="noninteractive" apt upgrade -y && DEBIAN_FRONTEND="noninteractive" apt install -y \
openjdk-11-jdk \
maven \
libfuse2 \
ssh \
openssh-server \
jsvc \
libxml2 \
ruby-dev \
build-essential \
libxml2-utils \
fuse
WORKDIR "/tmp"
COPY --from=builder /sdfs-build/install-packages/sdfs_${PKG_VERSION}_amd64.deb .
RUN dpkg -i sdfs_${PKG_VERSION}_amd64.deb && \
rm sdfs_${PKG_VERSION}_amd64.deb
RUN echo "* hard nofile 65535" >> /etc/security/limits.conf
RUN echo "* soft nofile 65535" >> /etc/security/limits.conf
COPY --from=builder /sdfs-build/install-packages/docker_run.sh /usr/share/sdfs/docker_run.sh
RUN chmod 700 /usr/share/sdfs/docker_run.sh
ENV DOCKER_DETATCH="-nodetach"
ENV CAPACITY=1TB
CMD ["/usr/share/sdfs/docker_run.sh"]