Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cache composer installs & install ca-certificates #3485

Merged
merged 1 commit into from
Apr 15, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 20 additions & 5 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ ENV DEBIAN_FRONTEND="noninteractive" \
# Everything from `make` onwards in apt-get install is only installed to ensure
# Python support works with all packages (which may require specific libraries
# at install time).

RUN apt-get update \
&& apt-get upgrade -y \
&& apt-get install -y --no-install-recommends \
Expand All @@ -19,6 +18,7 @@ RUN apt-get update \
bzr \
mercurial \
gnupg2 \
ca-certificates \
curl \
wget \
file \
Expand Down Expand Up @@ -48,7 +48,8 @@ RUN apt-get update \
libxmlsec1-dev \
libgeos-dev \
python3-enchant \
&& locale-gen en_US.UTF-8
&& locale-gen en_US.UTF-8 \
&& rm -rf /var/lib/apt/lists/*
feelepxyz marked this conversation as resolved.
Show resolved Hide resolved

ARG USER_UID=1000
ARG USER_GID=$USER_UID
Expand All @@ -70,7 +71,8 @@ RUN apt-add-repository ppa:brightbox/ruby-ng \
&& gem update --system 3.2.14 \
&& gem install bundler -v 1.17.3 --no-document \
&& gem install bundler -v 2.2.15 --no-document \
&& rm -Rf /var/lib/gems/2.6.0/cache/*
&& rm -rf /var/lib/gems/2.6.0/cache/* \
&& rm -rf /var/lib/apt/lists/*


### PYTHON
Expand Down Expand Up @@ -145,7 +147,19 @@ RUN add-apt-repository ppa:ondrej/php \
php7.4-tidy \
php7.4-xml \
php7.4-zip \
php7.4-zmq
php7.4-zmq \
&& rm -rf /var/lib/apt/lists/*
USER dependabot
# Perform a fake `composer update` to warm ~/dependabot/.cache/composer/repo
# with historic data (we don't care about package files here)
RUN mkdir /tmp/composer-cache \
&& cd /tmp/composer-cache \
&& echo '{"require":{"psr/log": "^1.1.3"}}' > composer.json \
&& composer update --no-scripts --dry-run \
&& cd /tmp \
&& rm -rf /home/dependabot/.cache/composer/files \
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Basing this on:

ls -la /home/dependabot/.cache/composer/repo/
total 12
drwxr-xr-x 3 dependabot dependabot 4096 Apr 14 12:55 .
drwxr-xr-x 4 dependabot dependabot 4096 Apr 14 12:55 ..
drwxr-xr-x 2 dependabot dependabot 4096 Apr 14 12:55 https---repo.packagist.org

Vs

ls -la /home/dependabot/.cache/composer/files/
total 32
drwxr-xr-x 8 dependabot dependabot 4096 Apr 14 12:55 .
drwxr-xr-x 4 dependabot dependabot 4096 Apr 14 12:55 ..
drwxr-xr-x 4 dependabot dependabot 4096 Apr 14 12:55 doctrine
drwxr-xr-x 3 dependabot dependabot 4096 Apr 14 12:55 friendsofphp
drwxr-xr-x 3 dependabot dependabot 4096 Apr 14 12:55 php-cs-fixer
drwxr-xr-x 3 dependabot dependabot 4096 Apr 14 12:55 phpstan
drwxr-xr-x 3 dependabot dependabot 4096 Apr 14 12:55 psr
drwxr-xr-x 8 dependabot dependabot 4096 Apr 14 12:55 symfony

&& rm -rf /tmp/composer-cache
USER root


### GO
Expand Down Expand Up @@ -181,7 +195,8 @@ RUN wget https://packages.erlang-solutions.com/erlang-solutions_1.0_all.deb \
&& echo "$ELIXIR_CHECKSUM Precompiled.zip" | sha512sum -c - \
&& unzip -d /usr/local/elixir -x Precompiled.zip \
&& rm -f Precompiled.zip erlang-solutions_1.0_all.deb \
&& mix local.hex --force
&& mix local.hex --force \
&& rm -rf /var/lib/apt/lists/*


### RUST
Expand Down