-
Notifications
You must be signed in to change notification settings - Fork 10
Expand file tree
/
Copy pathDockerfile
More file actions
141 lines (115 loc) · 4.06 KB
/
Dockerfile
File metadata and controls
141 lines (115 loc) · 4.06 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
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
FROM amazonlinux:2023 AS python3
# This image can be used to do Python 3 & NodeJS development, and
# includes the AWS CLI and Terraform. It contains:
#
# * CLI utilities: git, make, wget, etc
# * Python 3
# * NodeJS
# * Yarn
# * AWS CLI
# * Terraform
# * Docker
ENV TERRAFORM_VERSION="1.12.2"
ENV AWS_CLI_VERSION="2.27.43"
ARG USER
WORKDIR /CIRRUS-core
# Base packages + Python + Docker + Yarn
RUN dnf install -y \
gcc \
gcc-c++ \
git \
make \
unzip \
zip \
jq \
python3 \
python3-pip \
docker \
&& dnf clean all
ENV DOCKER_CONFIG=/tmp/.docker
RUN mkdir -p "$DOCKER_CONFIG" && chmod 1777 "$DOCKER_CONFIG"
# Remove any preexisting generic/older Node packages, then install Node 22/yarn globally
RUN dnf remove -y nodejs nodejs18 || true \
&& dnf install -y nodejs22\
&& dnf clean all
RUN npm install -g yarn
# Terraform
RUN \
curl "https://releases.hashicorp.com/terraform/${TERRAFORM_VERSION}/terraform_${TERRAFORM_VERSION}_linux_amd64.zip" -o "terraform.zip" && \
unzip -q terraform.zip && \
chmod +x terraform && \
mv terraform /usr/local/bin && \
rm -f terraform.zip
# AWS CLI
RUN \
curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64-${AWS_CLI_VERSION}.zip" -o "awscliv2.zip" && \
unzip -q awscliv2.zip && \
./aws/install && \
rm -rf aws awscliv2.zip
# SSM SessionManager plugin
RUN \
curl "https://s3.amazonaws.com/session-manager-downloads/plugin/latest/linux_64bit/session-manager-plugin.rpm" -o "session-manager-plugin.rpm" && \
dnf install -y ./session-manager-plugin.rpm && \
rm -f session-manager-plugin.rpm && \
dnf clean all
# Add user for keygen in Makefile
ARG USER
RUN echo "user:x:${USER}:0:root:/:/bin/bash" >> /etc/passwd
RUN python3 -m pip install --no-cache-dir boto3 setuptools
# Uncommenting fixes:
# fatal: detected dubious ownership in repository at '/CIRRUS-core'
# fatal: detected dubious ownership in repository at '/CIRRUS-DAAC'
# COPY .gitconfig /.gitconfig
WORKDIR /CIRRUS-core
# Bypass the bootstrap.sh script that runs in lambda
ENTRYPOINT []
FROM public.ecr.aws/lambda/python:3.12 AS python3.12
# This image can be used to do Python 3 & NodeJS development, and
# includes the AWS CLI and Terraform. It contains:
# * CLI utilities: git, make, wget, etc
# * Python 3
# * NodeJS
# * Yarn
# * AWS CLI
# * Terraform
# * Docker
ENV TERRAFORM_VERSION="1.12.2"
ENV AWS_CLI_VERSION="2.27.43"
# CLI utilities/docker
RUN dnf install -y gcc gcc-c++ git make unzip zip jq docker
ENV DOCKER_CONFIG=/tmp/.docker
RUN mkdir -p "$DOCKER_CONFIG" && chmod 1777 "$DOCKER_CONFIG"
# Terraform
RUN \
curl "https://releases.hashicorp.com/terraform/${TERRAFORM_VERSION}/terraform_${TERRAFORM_VERSION}_linux_amd64.zip" -o "terraform.zip" && \
unzip -q terraform.zip && \
chmod +x terraform && \
mv terraform /usr/local/bin && \
rm -f terraform.zip
# AWS CLI
RUN \
curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64-$AWS_CLI_VERSION.zip" -o "awscliv2.zip" && \
unzip -q awscliv2.zip && \
./aws/install && \
rm -rf aws awscliv2.zip
# Node JS
RUN \
dnf remove -y nodejs nodejs18 || true \
&& dnf install -y nodejs22 pip \
&& npm install -g yarn
# SSM SessionManager plugin
RUN \
curl "https://s3.amazonaws.com/session-manager-downloads/plugin/latest/linux_64bit/session-manager-plugin.rpm" -o "session-manager-plugin.rpm" && \
rpm -i session-manager-plugin.rpm && \
rm -f session-manager-plugin.rpm
# Add user for keygen in Makefile
ARG USER
RUN \
echo "user:x:${USER}:0:root:/:/bin/bash" >> /etc/passwd
RUN python3 -m pip install --no-cache-dir boto3 setuptools
# Uncommenting fixes: `fatal: detected dubious ownership in repository at '/CIRRUS-core'
# Uncommenting fixes: `fatal: detected dubious ownership in repository at '/CIRRUS-DAAC'
# COPY .gitconfig /.gitconfig
WORKDIR /CIRRUS-core
# Bypass the bootstrap.sh script that runs in lambda
ENTRYPOINT []