forked from pivotal/LicenseFinder
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
144 lines (120 loc) · 5.21 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
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
FROM ubuntu:xenial
# Versioning
ENV PIP_INSTALL_VERSION 10.0.1
ENV GO_LANG_VERSION 1.10.2
ENV MAVEN_VERSION 3.5.3
ENV SBT_VERSION 1.1.1
ENV GRADLE_VERSION 4.2
ENV RUBY_VERSION 2.5.1
ENV MIX_VERSION 1.0
# programs needed for building
RUN apt-get update && apt-get install -y \
build-essential \
curl \
git-core \
sudo \
unzip \
wget
# nodejs seems to be required for the one of the gems
RUN curl -sL https://deb.nodesource.com/setup_8.x | bash - && \
apt-get -y install nodejs
# install yarn
RUN curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add - && \
echo "deb https://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list && \
apt-get update && \
apt-get install yarn
# install bower
RUN npm install -g bower && \
echo '{ "allow_root": true }' > /root/.bowerrc
#install java 8
#http://askubuntu.com/questions/521145/how-to-install-oracle-java-on-ubuntu-14-04
RUN cd /tmp && \
wget --quiet --no-cookies --no-check-certificate --header "Cookie: gpw_e24=http%3A%2F%2Fwww.oracle.com%2F; oraclelicense=accept-securebackup-cookie" http://download.oracle.com/otn-pub/java/jdk/8u131-b11/d54c1d3a095b4ff2b6607d096fa80163/jdk-8u131-linux-x64.tar.gz -O jdk-8.tgz && \
tar xf /tmp/jdk-8.tgz && \
mkdir -p /usr/lib/jvm && \
mv jdk1.8.0_131 /usr/lib/jvm/oracle_jdk8 && \
rm /tmp/jdk-8.tgz
ENV J2SDKDIR=/usr/lib/jvm/oracle_jdk8
ENV J2REDIR=/usr/lib/jvm/oracle_jdk8/jre
ENV PATH=$PATH:/usr/lib/jvm/oracle_jdk8/bin:/usr/lib/jvm/oracle_jdk8/db/bin:/usr/lib/jvm/oracle_jdk8/jre/bin
ENV JAVA_HOME=/usr/lib/jvm/oracle_jdk8
ENV DERBY_HOME=/usr/lib/jvm/oracle_jdk8/db
RUN java -version
# install python and rebar
RUN apt-get install -y python rebar
# install and update python-pip
RUN apt-get install -y python-pip && \
pip install --upgrade pip==$PIP_INSTALL_VERSION
# install maven
RUN curl -O https://archive.apache.org/dist/maven/maven-3/$MAVEN_VERSION/binaries/apache-maven-$MAVEN_VERSION-bin.tar.gz && \
tar -xf apache-maven-$MAVEN_VERSION-bin.tar.gz; rm -rf apache-maven-$MAVEN_VERSION-bin.tar.gz && \
mv apache-maven-$MAVEN_VERSION /usr/local/lib/maven && \
ln -s /usr/local/lib/maven/bin/mvn /usr/local/bin/mvn
# install sbt
RUN mkdir -p /usr/local/share/sbt-launcher-packaging && \
curl --progress \
--retry 3 \
--retry-delay 15 \
--location "https://github.com/sbt/sbt/releases/download/v${SBT_VERSION}/sbt-${SBT_VERSION}.tgz" \
--output "/tmp/sbt-${SBT_VERSION}.tgz" && \
tar -xzf "/tmp/sbt-${SBT_VERSION}.tgz" -C /usr/local/share/sbt-launcher-packaging --strip-components=1 && \
ln -s /usr/local/share/sbt-launcher-packaging/bin/sbt /usr/local/bin/sbt && \
rm -f "/tmp/sbt-${SBT_VERSION}.tgz"
# install gradle
WORKDIR /tmp
RUN curl -L -o gradle.zip http://services.gradle.org/distributions/gradle-$GRADLE_VERSION-bin.zip && \
unzip -q gradle.zip && \
rm gradle.zip && \
mv gradle-$GRADLE_VERSION /root/gradle
ENV PATH=/root/gradle/bin:$PATH
#install go
WORKDIR /go
RUN wget https://storage.googleapis.com/golang/go$GO_LANG_VERSION.linux-amd64.tar.gz -O go.tar.gz && tar --strip-components=1 -xf go.tar.gz
ENV GOROOT /go
ENV PATH=$PATH:/go/bin
# godep is now required for license_finder to work for project that are still managed with GoDep
ENV GOROOT=/go
ENV GOPATH=/gopath
ENV PATH=$PATH:$GOPATH/bin
RUN mkdir /gopath && \
go get github.com/tools/godep && \
go get github.com/FiloSottile/gvt && \
go get github.com/Masterminds/glide && \
go get github.com/kardianos/govendor && \
go get github.com/golang/dep/cmd/dep
# Fix the locale
RUN apt-get install -y locales
RUN locale-gen en_US.UTF-8
ENV LANG=en_US.UTF-8
ENV LANGUAGE=en_US:en
ENV LC_ALL=en_US.UTF-8
#install rvm
RUN curl -sSL https://rvm.io/mpapis.asc | gpg --import && \
curl -sSL https://get.rvm.io | sudo bash -s stable --ruby=$RUBY_VERSION
ENV PATH=/usr/local/rvm/bin:$PATH
#install mix
RUN wget https://packages.erlang-solutions.com/erlang-solutions_${MIX_VERSION}_all.deb && \
sudo dpkg -i erlang-solutions_${MIX_VERSION}_all.deb && \
sudo apt-get update && \
sudo apt-get install -y esl-erlang && \
sudo apt-get install -y elixir
# install bundler
RUN bash -lc "gem update --system && gem install bundler"
# install conan
RUN apt-get install -y python-dev && \
pip install --ignore-installed six --ignore-installed colorama --ignore-installed requests --ignore-installed chardet --ignore-installed urllib3 --upgrade setuptools && \
pip install conan
# install Cargo
RUN curl -sSf https://static.rust-lang.org/rustup.sh | sh -s -- --disable-sudo
# install NuGet (w. mono)
# https://docs.microsoft.com/en-us/nuget/install-nuget-client-tools#macoslinux
RUN apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF &&\
echo "deb https://download.mono-project.com/repo/ubuntu stable-xenial main" | sudo tee /etc/apt/sources.list.d/mono-official-stable.list &&\
apt-get update &&\
apt-get install -y mono-complete &&\
curl -o /usr/local/bin/nuget.exe https://dist.nuget.org/win-x86-commandline/latest/nuget.exe &&\
echo "alias nuget=\"mono /usr/local/bin/nuget.exe\"" >> ~/.bash_aliases
# install license_finder
COPY . /LicenseFinder
RUN bash -lc "cd /LicenseFinder && bundle install -j4 && rake install"
WORKDIR /