|
1 |
| -# ubuntu:latest at 2020-05-12T09:35:28IST |
2 |
| -FROM ubuntu@sha256:3235326357dfb65f1781dbc4df3b834546d8bf914e82cce58e6e6b676e23ce8f |
| 1 | +# ubuntu:latest as of 2023-02-27 |
| 2 | +FROM ubuntu@sha256:9a0bdde4188b896a372804be2384015e90e3f84906b750c1a53539b585fbbe7f |
3 | 3 |
|
4 | 4 | LABEL "com.github.actions.icon"="check-circle"
|
5 | 5 | LABEL "com.github.actions.color"="green"
|
6 | 6 | LABEL "com.github.actions.name"="PHPCS Code Review"
|
7 |
| -LABEL "com.github.actions.description"="This will run phpcs on PRs" |
| 7 | +LABEL "com.github.actions.description"="Run automated code review using PHPCS on your pull requests." |
8 | 8 | LABEL "org.opencontainers.image.source"="https://github.com/rtCamp/action-phpcs-code-review"
|
9 | 9 |
|
10 |
| -RUN echo "tzdata tzdata/Areas select Asia" | debconf-set-selections && \ |
11 |
| -echo "tzdata tzdata/Zones/Asia select Kolkata" | debconf-set-selections |
12 |
| - |
13 |
| -RUN set -eux; \ |
14 |
| - apt-get update; \ |
15 |
| - apt install software-properties-common -y && \ |
16 |
| - add-apt-repository ppa:ondrej/php && \ |
17 |
| - DEBIAN_FRONTEND=noninteractive apt-get install -y \ |
18 |
| - cowsay \ |
19 |
| - git \ |
20 |
| - gosu \ |
21 |
| - jq \ |
22 |
| - php7.4-cli \ |
23 |
| - php7.4-common \ |
24 |
| - php7.4-curl \ |
25 |
| - php7.4-json \ |
26 |
| - php7.4-mbstring \ |
27 |
| - php7.4-mysql \ |
28 |
| - php7.4-xml \ |
29 |
| - php7.4-zip \ |
30 |
| - php-xml \ |
31 |
| - python \ |
32 |
| - python-pip \ |
33 |
| - rsync \ |
34 |
| - sudo \ |
35 |
| - tree \ |
36 |
| - vim \ |
37 |
| - zip \ |
38 |
| - unzip \ |
39 |
| - wget ; \ |
40 |
| - pip install shyaml; \ |
41 |
| - rm -rf /var/lib/apt/lists/*; \ |
42 |
| - # verify that the binary works |
43 |
| - gosu nobody true |
44 |
| - |
45 |
| -RUN useradd -m -s /bin/bash rtbot |
46 |
| - |
47 |
| -RUN wget https://raw.githubusercontent.com/Automattic/vip-go-ci/main/tools-init.sh -O tools-init.sh && \ |
48 |
| - bash tools-init.sh && \ |
49 |
| - rm -f tools-init.sh |
50 |
| - |
51 |
| -ENV VAULT_VERSION 1.4.3 |
52 |
| - |
53 |
| -# Setup Vault |
54 |
| -RUN wget https://releases.hashicorp.com/vault/${VAULT_VERSION}/vault_${VAULT_VERSION}_linux_amd64.zip && \ |
55 |
| - unzip vault_${VAULT_VERSION}_linux_amd64.zip && \ |
56 |
| - rm vault_${VAULT_VERSION}_linux_amd64.zip && \ |
57 |
| - mv vault /usr/local/bin/vault |
| 10 | +ARG VAULT_VERSION=1.12.3 |
| 11 | +ARG DEFAULT_PHP_VERSION=8.1 |
| 12 | +ARG PHP_BINARIES_TO_PREINSTALL='7.4 8.0 8.1 8.2' |
| 13 | + |
| 14 | +ENV DOCKER_USER=rtbot |
| 15 | +ENV ACTION_WORKDIR=/home/$DOCKER_USER |
| 16 | +ENV DEBIAN_FRONTEND=noninteractive |
| 17 | + |
| 18 | +RUN useradd -m -s /bin/bash $DOCKER_USER \ |
| 19 | + && mkdir -p $ACTION_WORKDIR \ |
| 20 | + && chown -R $DOCKER_USER $ACTION_WORKDIR |
| 21 | + |
| 22 | +RUN set -ex \ |
| 23 | + && savedAptMark="$(apt-mark showmanual)" \ |
| 24 | + && apt-mark auto '.*' > /dev/null \ |
| 25 | + && apt-get update && apt-get install -y --no-install-recommends git ca-certificates wget rsync gnupg jq software-properties-common unzip \ |
| 26 | + && LC_ALL=C.UTF-8 add-apt-repository ppa:ondrej/php \ |
| 27 | + && apt-get update \ |
| 28 | + && for v in $PHP_BINARIES_TO_PREINSTALL; do \ |
| 29 | + apt-get install -y --no-install-recommends \ |
| 30 | + php"$v" \ |
| 31 | + php"$v"-curl \ |
| 32 | + php"$v"-tokenizer \ |
| 33 | + php"$v"-simplexml \ |
| 34 | + php"$v"-xmlwriter; \ |
| 35 | + done \ |
| 36 | + && update-alternatives --set php /usr/bin/php${DEFAULT_PHP_VERSION} \ |
| 37 | + && wget https://releases.hashicorp.com/vault/${VAULT_VERSION}/vault_${VAULT_VERSION}_linux_amd64.zip \ |
| 38 | + && unzip vault_${VAULT_VERSION}_linux_amd64.zip \ |
| 39 | + && mv vault /usr/local/bin/vault \ |
| 40 | + # cleanup |
| 41 | + && rm -f vault_${VAULT_VERSION}_linux_amd64.zip \ |
| 42 | + && apt-get remove software-properties-common unzip -y \ |
| 43 | + && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* \ |
| 44 | + && { [ -z "$savedAptMark" ] || apt-mark manual $savedAptMark > /dev/null; } \ |
| 45 | + && find /usr/local -type f -executable -exec ldd '{}' ';' \ |
| 46 | + | awk '/=>/ { print $(NF-1) }' \ |
| 47 | + | sort -u \ |
| 48 | + | xargs -r dpkg-query --search \ |
| 49 | + | cut -d: -f1 \ |
| 50 | + | sort -u \ |
| 51 | + | xargs -r apt-mark manual \ |
| 52 | + && apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false \ |
| 53 | + # smoke test |
| 54 | + && for v in $PHP_BINARIES_TO_PREINSTALL; do \ |
| 55 | + php"$v" -v; \ |
| 56 | + done \ |
| 57 | + && php -v \ |
| 58 | + && vault -v; |
58 | 59 |
|
59 | 60 | COPY entrypoint.sh main.sh /usr/local/bin/
|
60 |
| -RUN chmod +x /usr/local/bin/*.sh |
| 61 | + |
| 62 | +RUN chmod +x /usr/local/bin/entrypoint.sh /usr/local/bin/main.sh |
| 63 | + |
| 64 | +USER $DOCKER_USER |
| 65 | + |
| 66 | +WORKDIR $ACTION_WORKDIR |
| 67 | + |
| 68 | +RUN wget https://raw.githubusercontent.com/Automattic/vip-go-ci/latest/tools-init.sh -O tools-init.sh \ |
| 69 | + && bash tools-init.sh \ |
| 70 | + && rm -f tools-init.sh |
61 | 71 |
|
62 | 72 | ENTRYPOINT ["/usr/local/bin/entrypoint.sh"]
|
0 commit comments