forked from myrmex-org/docker-lambda-packager
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathal1.Dockerfile
More file actions
executable file
·49 lines (38 loc) · 1.47 KB
/
al1.Dockerfile
File metadata and controls
executable file
·49 lines (38 loc) · 1.47 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
FROM amazonlinux:1
MAINTAINER Alexis N-o "alexis@henaut.net"
ENV DEFAULT_USER=myrmex
ENV NODE_VERSION_6 6.10.3
ENV NODE_VERSION_8 8.10.0
ENV PYTHON_VERSION_3_6 3.6.8
ENV PYTHON_VERSION_3_7 3.7.3
# Install gcc add utilities to manage users and permissions
RUN yum install -y gcc-c++ util-linux shadow-utils zlib-devel openssl-devel libffi-devel
# Add scripts to install node and python versions
COPY /install-node.sh /install-node.sh
COPY /install-python.sh /install-python.sh
# Install node v6 and node v8 as commands "node6" and "node8"
# Command "node" defaults to v8
RUN /install-node.sh ${NODE_VERSION_6} &&\
/install-node.sh ${NODE_VERSION_8}
# Install python 3.6 and python 3.7 including pip, python 2.7 is already available
# Command "python3" defaults to 3.7
RUN curl -O https://bootstrap.pypa.io/get-pip.py &&\
python get-pip.py &&\
/install-python.sh ${PYTHON_VERSION_3_6} &&\
/install-python.sh ${PYTHON_VERSION_3_7}
# Add a script to modify the UID / GID for the default user if needed
COPY /usr/local/bin/change-uid /usr/local/bin/change-uid
RUN chmod +x /usr/local/bin/change-uid
# Add a non root user
RUN useradd $DEFAULT_USER -m -d /home/$DEFAULT_USER/ -s /bin/bash
# Create working directory
RUN mkdir /data && chown $DEFAULT_USER:$DEFAULT_USER /data
WORKDIR /data
# Add entrypoint
COPY /al1.entrypoint.sh /entrypoint.sh
RUN chmod +x /entrypoint.sh
ENTRYPOINT ["/entrypoint.sh"]
# Add default command
COPY /cmd.sh /cmd.sh
RUN chmod +x /cmd.sh
CMD ["/cmd.sh"]