-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathDockerfile
More file actions
117 lines (92 loc) · 2.72 KB
/
Dockerfile
File metadata and controls
117 lines (92 loc) · 2.72 KB
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
#############################################################################
# Dockerfile to build an image with Git, php-cli and composer
# Based on yesops/ubuntu:latest
#############################################################################
## Set the base image to Ubuntu
FROM ubuntu:20.04
MAINTAINER Sodep <info@sodep.com.py>
# Set the locale
RUN apt-get clean && apt-get update
RUN apt-get -y install wget locales locales-all
## Update locale
RUN echo 'debconf debconf/frontend select Noninteractive' | debconf-set-selections
RUN echo "en_US.UTF-8 UTF-8" >> /etc/locale.gen
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 basic things
RUN apt-get install -y --no-install-recommends \
gpg-agent \
libpng-dev \
apt-transport-https \
software-properties-common \
openssh-client \
curl \
ca-certificates \
wget \
git \
gcc \
make \
mcrypt \
libxrender1 \
libxtst6
## Add php repository
RUN add-apt-repository ppa:ondrej/php -y
## Add git repository
RUN add-apt-repository ppa:git-core/ppa -y
## Add yarn repository
RUN curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add -
RUN echo "deb https://dl.yarnpkg.com/debian/ stable main" | tee /etc/apt/sources.list.d/yarn.list
## Installs PHP
RUN apt-get update && \
apt-get -y install \
php-cli \
php-curl \
php-mbstring \
php-gd \
php-mysql \
php-json \
php-ldap \
php-mime-type \
php-pgsql \
php-tidy \
php-intl \
php-xmlrpc \
php-soap \
php-uploadprogress \
php-zip && \
apt-get -y autoremove && \
apt-get -y install --no-install-recommends imagemagick && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*
## Upgrades
RUN apt-get dist-upgrade -y
## Install node and npm
RUN apt-get update && apt-get install -y nodejs npm
## Install Snyk cli
RUN npm install snyk@latest -g
## Install composer
RUN curl -sS https://getcomposer.org/installer | php
RUN mv composer.phar /usr/local/bin/composer
## Add composer bin to PATH
ENV PATH "$PATH:$HOME/.composer/vendor/bin"
## Install composer plugins
RUN /usr/local/bin/composer global require "laravel/envoy:^1.4"
RUN mkdir -p "/usr/course"
WORKDIR /usr/course/
RUN git clone https://github.com/sonatype-nexus-community/bach.git
WORKDIR /usr/course/bach
RUN composer install
RUN echo "Adding repositories"
RUN mkdir -p "/usr/course/repositories/sonar"
RUN mkdir -p "/usr/course/repositories/snyk"
RUN mkdir -p "/usr/course/repositories/bach"
WORKDIR /tmp
RUN mkdir -p "/opt/sonar-scanner"
WORKDIR /opt/sonar-scanner
COPY sonar-scanner .
ENV PATH="/opt/sonar-scanner/bin:${PATH}"
RUN apt-get -y install telnet
WORKDIR /usr/course
CMD ["bash"]