forked from elastic/logstash
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile.base
45 lines (35 loc) · 1.64 KB
/
Dockerfile.base
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
#logstash-base image, use ci/docker_update_base_image.sh to push updates
FROM ubuntu:xenial
RUN apt-get update && \
apt-get install -y zlib1g-dev build-essential vim rake git curl libssl-dev libreadline-dev libyaml-dev \
libxml2-dev libxslt-dev openjdk-8-jdk-headless curl iputils-ping netcat && \
apt-get clean
WORKDIR /root
RUN adduser --disabled-password --gecos "" --home /home/logstash logstash && \
mkdir -p /usr/local/share/ruby-build && \
mkdir -p /opt/logstash && \
mkdir -p /mnt/host && \
chown logstash:logstash /opt/logstash
USER logstash
WORKDIR /home/logstash
RUN git clone https://github.com/sstephenson/rbenv.git .rbenv && \
git clone https://github.com/sstephenson/ruby-build.git .rbenv/plugins/ruby-build && \
echo 'export PATH=/home/logstash/.rbenv/bin:$PATH' >> /home/logstash/.bashrc
ENV PATH "/home/logstash/.rbenv/bin:$PATH"
#Only used to help bootstrap the build (not to run Logstash itself)
RUN echo 'eval "$(rbenv init -)"' >> .bashrc && \
rbenv install jruby-9.1.12.0 && \
rbenv global jruby-9.1.12.0 && \
bash -i -c 'gem install bundler' && \
rbenv local jruby-9.1.12.0 && \
mkdir -p /opt/logstash/data
# Create a cache for the dependencies based on the current master, any dependencies not cached will be downloaded at runtime
RUN git clone https://github.com/elastic/logstash.git /tmp/logstash && \
cd /tmp/logstash && \
./gradlew bootstrap compileJava compileTestJava && \
cd qa/integration && \
/home/logstash/.rbenv/shims/bundle install && \
mv /tmp/logstash/vendor /tmp/vendor && \
rm -rf /tmp/logstash
# used by the purge policy
LABEL retention="keep"