-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathDockerfile
More file actions
42 lines (40 loc) · 1.94 KB
/
Dockerfile
File metadata and controls
42 lines (40 loc) · 1.94 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
ARG OS_NAME
ARG OS_VERSION
FROM $OS_NAME:$OS_VERSION as build
ARG OS_NAME
ARG OS_VERSION
ARG TARGETARCH
RUN if [ "${OS_NAME}" = "debian" ] || [ "${OS_NAME}" = "ubuntu" ]; then \
apt-get update -qq && DEBIAN_FRONTEND=noninteractive apt-get install -qq curl ca-certificates unzip --no-install-recommends; \
elif [ "${OS_NAME}" = "amazonlinux" ]; then \
yum install -y -q findutils unzip; \
fi
RUN if [ "$TARGETARCH" = "amd64" ]; then ARCHITECTURE="x86_64"; elif [ "$TARGETARCH" = "arm64" ]; then ARCHITECTURE="aarch64"; else echo "Unsupported architecture: $TARGETARCH" && exit 1; fi && \
curl -sSLf "https://awscli.amazonaws.com/awscli-exe-linux-${ARCHITECTURE}.zip" -o "awscliv2.zip"
RUN unzip awscliv2.zip
RUN ./aws/install
COPY --from=truemark/jq:latest /usr/local/ /usr/local/
COPY helper.sh /usr/local/bin/helper.sh
FROM $OS_NAME:$OS_VERSION as test
ARG OS_NAME
ARG OS_VERSION
COPY --from=build /usr/local/ /usr/local/
COPY test.sh /test.sh
RUN if [ "${OS_NAME}" = "debian" ] || [ "${OS_NAME}" = "ubuntu" ]; then \
apt-get update -qq && DEBIAN_FRONTEND=noninteractive apt-get install -qq groff --no-install-recommends && apt-get -qq clean && rm -rf /var/lib/apt/lists; \
elif [ "${OS_NAME}" = "amazonlinux" ]; then \
yum install -y -q groff && yum clean all; \
fi
RUN /test.sh
FROM $OS_NAME:$OS_VERSION
ARG OS_NAME
ARG OS_VERSION
COPY --from=test /usr/local/ /usr/local/
RUN if [ "${OS_NAME}" = "debian" ] || [ "${OS_NAME}" = "ubuntu" ]; then \
apt-get update -qq && DEBIAN_FRONTEND=noninteractive apt-get install -qq groff tar zip unzip gzip bzip2 curl ca-certificates findutils --no-install-recommends && apt-get -qq clean && rm -rf /var/lib/apt/lists; \
elif [ "${OS_NAME}" = "amazonlinux" ]; then \
yum install -y -q groff tar zip unzip gzip bzip2 findutils which && yum clean all; \
fi
RUN echo "source /usr/local/bin/helper.sh && initialize" >> /root/.bashrc && \
chmod +x /root/.bashrc
ENTRYPOINT ["aws"]