-
Notifications
You must be signed in to change notification settings - Fork 24
/
Dockerfile-jenkins-build
93 lines (75 loc) · 3.16 KB
/
Dockerfile-jenkins-build
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
FROM debian:latest
MAINTAINER Rick Golden "golden@golden-garage.net"
#modified for jenkins build
# build arguments
ARG APP_PACKAGES=openssh-client\ procps\ locales\ ca-certificates\ apt-transport-https\ xz-utils\ unzip\ bzip2\ wget\ libgconf-2-4\ git
ARG APP_LOCALE=en_US
ARG APP_CHARSET=UTF-8
ARG APP_USER=app
ARG APP_USER_DIR=/home/${APP_USER}
# run environment
ENV APP_PORT=${APP_PORT:-3000}
ENV APP_ROOT=${APP_ROOT:-/app}
# exposed ports and volumes
EXPOSE $APP_PORT
VOLUME $APP_ROOT
# add packages for building NPM modules (required by Meteor)
RUN DEBIAN_FRONTEND=noninteractive apt-get update && apt-get install -y software-properties-common gpg gpg-agent && \
apt-get update && \
apt-get -y dist-upgrade && \
apt-get install -y curl gzip python build-essential ${APP_PACKAGES} && \
apt-get -y -o Dpkg::Options::="--force-overwrite" install openjdk-11-jdk && \
apt-get autoremove && \
apt-get clean
# set the locale (required by Meteor)
#RUN localedef ${APP_LOCALE}.${APP_CHARSET} -i ${APP_LOCALE} -f ${APP_CHARSET}
# create a non-root user that can write to /usr/local (suggested by Meteor)
#RUN useradd -mUd ${APP_USER_DIR} ${APP_USER}
#RUN chown -Rh ${APP_USER} /usr/local
#USER ${APP_USER}
#ENV MONGO_URL=mongodb://10.10.2.20:27017/padawan
#==========
# Chrome
#==========
RUN wget -q -O - https://dl.google.com/linux/linux_signing_key.pub | apt-key add - \
&& echo "deb https://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google-chrome.list \
&& apt-get update -qqy \
&& apt-get -qqy install google-chrome-unstable \
&& rm /etc/apt/sources.list.d/google-chrome.list \
&& rm -rf /var/lib/apt/lists/* /var/cache/apt/*
RUN mkdir /data
#==========
# Selenium
#==========
RUN mkdir -p /opt/selenium \
&& wget --no-verbose https://selenium-release.storage.googleapis.com/3.141/selenium-server-standalone-3.141.59.jar -O /opt/selenium/selenium-server-standalone.jar
#==================
# Chrome webdriver
#==================
ARG CHROME_DRIVER_VERSION=2.35
RUN wget --no-verbose -O /tmp/chromedriver_linux64.zip https://chromedriver.storage.googleapis.com/$CHROME_DRIVER_VERSION/chromedriver_linux64.zip \
&& rm -rf /opt/selenium/chromedriver \
&& unzip /tmp/chromedriver_linux64.zip -d /opt/selenium \
&& rm /tmp/chromedriver_linux64.zip \
&& mv /opt/selenium/chromedriver /opt/selenium/chromedriver-$CHROME_DRIVER_VERSION \
&& chmod 755 /opt/selenium/chromedriver-$CHROME_DRIVER_VERSION \
&& ln -fs /opt/selenium/chromedriver-$CHROME_DRIVER_VERSION /usr/bin/chromedriver
ENV NPM_CONFIG_LOGLEVEL info
ENV NODE_VERSION 8.11.1
# meteor installer doesn't work with the default tar binary
#RUN apt-get install -y bsdtar \
# && cp $(which tar) $(which tar)~ \
# && ln -sf $(which bsdtar) $(which tar)
# install Meteor
RUN curl "https://install.meteor.com/" | sh
# put back the original tar
#RUN mv $(which tar)~ $(which tar)
# run Meteor from the app directory
WORKDIR ${APP_ROOT}
COPY entrypoint.sh /
RUN chmod +x /entrypoint.sh
#RUN /usr/local/bin/meteor --allow-superuser update --release 1.7.1-beta.15
#RUN /usr/local/bin/meteor npm install @babel/runtime@7.0.0-beta.55
RUN /usr/local/bin/meteor npm install
EXPOSE 3000
CMD [ "/entrypoint.sh" ]