-
Notifications
You must be signed in to change notification settings - Fork 41
/
Dockerfile
85 lines (63 loc) · 2.89 KB
/
Dockerfile
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
FROM ubuntu:latest as buildcontainer
ARG DEBIAN_FRONTEND=noninteractive
ENV GOSU_VERSION 1.11
# hybris needs unzip and lsof for the solr server setup
RUN apt-get update \
&& apt-get install -y --no-install-recommends ca-certificates wget \
&& apt-get install -y --install-recommends gnupg2 dirmngr
# grab gosu for easy step-down from root
RUN set -x \
&& dpkgArch="$(dpkg --print-architecture | awk -F- '{ print $NF }')" \
&& wget -O /usr/local/bin/gosu "https://github.com/tianon/gosu/releases/download/$GOSU_VERSION/gosu-$dpkgArch" \
&& wget -O /usr/local/bin/gosu.asc "https://github.com/tianon/gosu/releases/download/$GOSU_VERSION/gosu-$dpkgArch.asc" \
&& export GNUPGHOME="$(mktemp -d)" \
&& gpg --keyserver ha.pool.sks-keyservers.net --recv-keys B42F6819007F00F88E364FD4036A9C25BF357DD4 \
&& gpg --batch --verify /usr/local/bin/gosu.asc /usr/local/bin/gosu \
&& command -v gpgconf && gpgconf --kill all || : \
&& rm -r "$GNUPGHOME" /usr/local/bin/gosu.asc \
&& chmod +x /usr/local/bin/gosu \
&& gosu --version \
&& gosu nobody true
FROM ubuntu:latest
MAINTAINER Stefan Lehmann <[email protected]>
ARG HYBRIS_HOME=/home/hybris
ARG VCS_REF
LABEL org.label-schema.vcs-ref=$VCS_REF \
org.label-schema.vcs-url="https://github.com/stefanleh/hybris-base-image"
ARG DEBIAN_FRONTEND=noninteractive
# hybris needs the JAVA_HOME environment variable even if java is in path
ENV JAVA_HOME /usr/lib/jvm/java-8-oracle
# hybris needs unzip and lsof for the solr server setup
RUN apt-get update \
&& apt-get install -y --no-install-recommends software-properties-common apt-utils ca-certificates net-tools curl unzip lsof wget \
&& add-apt-repository ppa:webupd8team/java \
&& echo oracle-java8-installer shared/accepted-oracle-license-v1-1 select true | /usr/bin/debconf-set-selections \
&& apt-get install -y oracle-java8-installer \
&& apt-get autoclean && apt-get --purge -y autoremove \
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* /var/cache/* /usr/lib/jvm/java-8-oracle/*src.zip
# copy gosu from buildcontainer over
COPY --from=buildcontainer /usr/local/bin/gosu /usr/local/bin/gosu
# set the PLATFORM_HOME environment variable used by hybris
ENV PLATFORM_HOME=${HYBRIS_HOME}/bin/platform/
ENV PATH=$PLATFORM_HOME:$PATH
ENV HYBRIS_HOME=${HYBRIS_HOME}
# add hybris user
RUN useradd -d ${HYBRIS_HOME} -u 1000 -m -s /bin/bash hybris
# define hybris home dir as volume
VOLUME ${HYBRIS_HOME}
# expose hybris ports
EXPOSE 9001
EXPOSE 9002
# expose default solr port
EXPOSE 8983
# expose the default debug port for connecting via IDE
EXPOSE 8000
# copy the entrypoint script over
COPY entrypoint.sh /entrypoint.sh
RUN chmod +x /entrypoint.sh
# copy the update system config to image
COPY updateRunningSystem.config ${HYBRIS_HOME}/updateRunningSystem.config
WORKDIR ${HYBRIS_HOME}
# set entrypoint of container
ENTRYPOINT ["/entrypoint.sh"]
CMD ["run"]