-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
116 lines (105 loc) · 3.16 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
# Use the standard Amazon Linux base
FROM amazonlinux:2
# Framework Versions
ENV VERSION_NODE_12=12
ENV VERSION_NODE_14=14
ENV VERSION_NODE_DEFAULT=$VERSION_NODE_14
ENV VERSION_YARN=1.22.0
ENV VERSION_AMPLIFY=4.29.4
# UTF-8 Environment
ENV LANGUAGE en_US:en
ENV LANG=en_US.UTF-8
ENV LC_ALL en_US.UTF-8
## Install OS packages
RUN touch ~/.bashrc
RUN yum -y update && \
yum -y install \
alsa-lib-devel \
autoconf \
automake \
bzip2 \
bison \
bzr \
cmake \
expect \
fontconfig \
git \
gcc-c++ \
GConf2-devel \
gtk2-devel \
gtk3-devel \
libnotify-devel \
libpng \
libpng-devel \
libffi-devel \
libtool \
libX11 \
libXext \
libxml2 \
libxml2-devel \
libXScrnSaver \
libxslt \
libxslt-devel \
libyaml \
libyaml-devel \
make \
nss-devel \
openssl-devel \
openssh-clients \
patch \
procps \
python3 \
python3-devel \
readline-devel \
sqlite-devel \
tar \
tree \
unzip \
wget \
which \
xorg-x11-server-Xvfb \
zip \
zlib \
zlib-devel \
yum clean all && \
rm -rf /var/cache/yum
## Install python3.8
RUN wget https://www.python.org/ftp/python/3.8.0/Python-3.8.0.tgz
RUN tar xvf Python-3.8.0.tgz
WORKDIR Python-3.8.0
RUN ./configure --enable-optimizations --prefix=/usr/local
RUN make altinstall
## Install Node 12 & 14
RUN curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.11/install.sh | bash
RUN curl -o- -L https://yarnpkg.com/install.sh > /usr/local/bin/yarn-install.sh
RUN /bin/bash -c ". ~/.nvm/nvm.sh && \
nvm install $VERSION_NODE_12 && nvm use $VERSION_NODE_12 && \
bash /usr/local/bin/yarn-install.sh --version $VERSION_YARN && \
nvm install $VERSION_NODE_14 && nvm use $VERSION_NODE_14 && \
npm install -g sm grunt-cli bower vuepress gatsby-cli && \
bash /usr/local/bin/yarn-install.sh --version $VERSION_YARN && \
nvm alias default node && nvm cache clear"
## Install awscli
RUN /bin/bash -c "pip3.8 install awscli && rm -rf /var/cache/apk/*"
## Install SAM CLI
RUN /bin/bash -c "pip3.8 install aws-sam-cli"
## Installing Cypress
RUN /bin/bash -c ". ~/.nvm/nvm.sh && \
nvm use ${VERSION_NODE_DEFAULT} && \
npm install -g --unsafe-perm=true --allow-root cypress"
## Install AWS Amplify CLI for VERSION_NODE_12 and VERSION_NODE_14
RUN /bin/bash -c ". ~/.nvm/nvm.sh && nvm use ${VERSION_NODE_12} && \
npm install -g @aws-amplify/cli@${VERSION_AMPLIFY}"
RUN /bin/bash -c ". ~/.nvm/nvm.sh && nvm use ${VERSION_NODE_14} && \
npm install -g @aws-amplify/cli@${VERSION_AMPLIFY}"
## Environment Setup
RUN echo export PATH="\
/root/.yarn/bin:\
/root/.config/yarn/global/node_modules/.bin:\
/root/.nvm/versions/node/${VERSION_NODE_DEFAULT}/bin:\
$(python3.8 -m site --user-base)/bin:\
$(python3 -m site --user-base)/bin:\
$PATH" >> ~/.bashrc && \
echo "nvm use ${VERSION_NODE_DEFAULT} 1> /dev/null" >> ~/.bashrc \
echo "export PATH=$PATH:/root/.dotnet/tools" >> ~/.bashrc
ENTRYPOINT [ "bash", "-c" ]