-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
46 lines (40 loc) · 1.69 KB
/
Copy pathDockerfile
File metadata and controls
46 lines (40 loc) · 1.69 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
FROM ubuntu:22.04
# Base on the two Dockerfiles here: https://github.com/GoogleCloudPlatform/cloud-builders/tree/master/docker
RUN apt-get -y update && \
apt-get -y install \
apt-transport-https \
ca-certificates \
curl \
jq \
make \
software-properties-common && \
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | \
gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg && \
echo "deb [arch=$(dpkg --print-architecture) \
signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] \
https://download.docker.com/linux/ubuntu \
$(lsb_release -cs) stable" > /etc/apt/sources.list.d/docker.list && \
apt-get -y update && \
apt-get -y dist-upgrade && \
apt-get autoremove && \
apt-get clean
# Install amazon-ecr-credential-helper
# To configure: https://github.com/awslabs/amazon-ecr-credential-helper?tab=readme-ov-file#configuration
# ecr-login is not configured because it conflicts with docker login commands https://github.com/awslabs/amazon-ecr-credential-helper/issues/102
RUN apt-get -y install \
docker-ce \
docker-ce-cli \
docker-compose docker-compose-plugin \
amazon-ecr-credential-helper && \
apt-get clean
# Configure amazon-ecr-credential-helper
# Create docker config directory and set up credential helper
RUN mkdir -p /root/.docker && \
echo '{"credsStore": "ecr-login"}' > /root/.docker/config.json
# Make a symlink for dockerd so it can be found by codebuild
RUN ln -s /usr/bin/dockerd /usr/local/bin/dockerd
# Add amazon-ecr-credential-helper to PATH
ENV PATH="/usr/bin:$PATH"
ARG RAILPACK_VERSION
ENV RAILPACK_VERSION=${RAILPACK_VERSION}
RUN curl -fsSL https://railpack.com/install.sh | bash