forked from trussworks/docker-gh
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
63 lines (56 loc) · 2.84 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
# CircleCI docker image to run within
FROM cimg/python:3.10.1
# Base image uses "circleci", to avoid using `sudo` run as root user
USER root
# install shellcheck
ARG SHELLCHECK_VERSION=0.7.1
ARG SHELLCHECK_SHA256SUM=64f17152d96d7ec261ad3086ed42d18232fcb65148b44571b564d688269d36c8
RUN set -ex && cd ~ \
&& curl -sSLO https://github.com/koalaman/shellcheck/releases/download/v${SHELLCHECK_VERSION}/shellcheck-v${SHELLCHECK_VERSION}.linux.x86_64.tar.xz \
&& [ $(sha256sum shellcheck-v${SHELLCHECK_VERSION}.linux.x86_64.tar.xz | cut -f1 -d' ') = ${SHELLCHECK_SHA256SUM} ] \
&& tar xvfa shellcheck-v${SHELLCHECK_VERSION}.linux.x86_64.tar.xz \
&& mv shellcheck-v${SHELLCHECK_VERSION}/shellcheck /usr/local/bin \
&& chown root:root /usr/local/bin/shellcheck \
&& rm -vrf shellcheck-v${SHELLCHECK_VERSION} shellcheck-v${SHELLCHECK_VERSION}.linux.x86_64.tar.xz
# install circleci cli
ARG CIRCLECI_CLI_VERSION=0.1.9321
ARG CIRCLECI_CLI_SHA256SUM=26a4b0c56c1e0ad32ee42368ee098dbe8e917006cbd45c36a5cfc079f6888d3b
RUN set -ex && cd ~ \
&& curl -sSLO https://github.com/CircleCI-Public/circleci-cli/releases/download/v${CIRCLECI_CLI_VERSION}/circleci-cli_${CIRCLECI_CLI_VERSION}_linux_amd64.tar.gz \
&& [ $(sha256sum circleci-cli_${CIRCLECI_CLI_VERSION}_linux_amd64.tar.gz | cut -f1 -d' ') = ${CIRCLECI_CLI_SHA256SUM} ] \
&& tar xzf circleci-cli_${CIRCLECI_CLI_VERSION}_linux_amd64.tar.gz \
&& mv circleci-cli_${CIRCLECI_CLI_VERSION}_linux_amd64/circleci /usr/local/bin \
&& chmod 755 /usr/local/bin/circleci \
&& chown root:root /usr/local/bin/circleci \
&& rm -vrf circleci-cli_${CIRCLECI_CLI_VERSION}_linux_amd64 circleci-cli_${CIRCLECI_CLI_VERSION}_linux_amd64.tar.gz
# install awscliv2, disable default pager (less)
ENV AWS_PAGER=""
ARG AWSCLI_VERSION=2.0.37
COPY sigs/awscliv2_pgp.key /tmp/awscliv2_pgp.key
RUN gpg --import /tmp/awscliv2_pgp.key
RUN set -ex && cd ~ \
&& curl -sSL "https://awscli.amazonaws.com/awscli-exe-linux-x86_64-${AWSCLI_VERSION}.zip" -o awscliv2.zip \
&& curl -sSL "https://awscli.amazonaws.com/awscli-exe-linux-x86_64-${AWSCLI_VERSION}.zip.sig" -o awscliv2.sig \
&& gpg --verify awscliv2.sig awscliv2.zip \
&& unzip awscliv2.zip \
&& ./aws/install --update \
&& aws --version \
&& rm -r awscliv2.zip awscliv2.sig aws
ARG GH_CLI_VERSION=""
RUN apt-key adv --keyserver keyserver.ubuntu.com --recv-key C99B11DEB97541F0 \
&& apt-add-repository https://cli.github.com/packages \
&& apt update \
&& apt install gh
# apt-get all the things
# Notes:
# - Add all apt sources first
# - groff and less required by AWS CLI
ARG CACHE_APT
RUN set -ex && cd ~ \
&& apt-get update \
&& : Install apt packages \
&& apt-get -qq -y install --no-install-recommends apt-transport-https less groff lsb-release \
&& : Cleanup \
&& apt-get clean \
&& rm -vrf /var/lib/apt/lists/*
USER circleci