From 810eb56c1cea95a422749dfa3ee77c4aa02cd191 Mon Sep 17 00:00:00 2001 From: mtgto Date: Mon, 17 Feb 2020 10:01:29 +0900 Subject: [PATCH] Fix apk add argument "--update" to "--update-cache" --- README.md | 16 ++++++++-------- images/Dockerfile | 8 ++++---- sandbox/Dockerfile | 4 ++-- 3 files changed, 14 insertions(+), 14 deletions(-) diff --git a/README.md b/README.md index a20b88d8..8e54a7ca 100644 --- a/README.md +++ b/README.md @@ -70,15 +70,15 @@ ADD https://dl.bintray.com/php-alpine/key/php-alpine.rsa.pub /etc/apk/keys/php-a ## you may join the multiple run lines here to make it a single layer # make sure you can use HTTPS -RUN apk --update add ca-certificates +RUN apk --update-cache add ca-certificates # add the repository, make sure you replace the correct versions if you want. RUN echo "https://dl.bintray.com/php-alpine/v3.9/php-7.3" >> /etc/apk/repositories # install php and some extensions -RUN apk add --update php -RUN apk add --update php-mbstring -RUN apk add --update php-you-extension-name-here +RUN apk add --update-cache php +RUN apk add --update-cache php-mbstring +RUN apk add --update-cache php-you-extension-name-here ``` ### Bash / Shell scripting @@ -90,7 +90,7 @@ RUN apk add --update php-you-extension-name-here #!/usr/bin/env sh # install curl and certificates to download the key -apk add --update curl ca-certificates +apk add --update-cache curl ca-certificates # download the repository public key curl https://dl.bintray.com/php-alpine/key/php-alpine.rsa.pub -o /etc/apk/keys/php-alpine.rsa.pub @@ -99,9 +99,9 @@ curl https://dl.bintray.com/php-alpine/key/php-alpine.rsa.pub -o /etc/apk/keys/p echo "https://dl.bintray.com/php-alpine/v3.9/php-7.3" >> /etc/apk/repositories # install packages -apk add --update php -apk add --update php-redis -apk add --update php-any-other-extension +apk add --update-cache php +apk add --update-cache php-redis +apk add --update-cache php-any-other-extension ``` diff --git a/images/Dockerfile b/images/Dockerfile index cf9d8f24..701832bc 100644 --- a/images/Dockerfile +++ b/images/Dockerfile @@ -15,22 +15,22 @@ ARG ALPINE_VERSION ARG PHP_VERSION # ADD SDK AND BASIC TOOLS. -RUN apk add --update alpine-sdk sudo git bash nano +RUN apk add --update-cache alpine-sdk sudo git bash nano # trust this project public key to trust the packages. ADD https://dl.bintray.com/php-alpine/key/php-alpine.rsa.pub /etc/apk/keys/php-alpine.rsa.pub # make sure you can use HTTPS -RUN apk --update add ca-certificates +RUN apk --update-cache add ca-certificates # CONFIGURE ALPINE REPOSITORIES AND PHP BUILD DIR. RUN echo "http://dl-cdn.alpinelinux.org/alpine/v${ALPINE_VERSION}/main" > /etc/apk/repositories && \ echo "http://dl-cdn.alpinelinux.org/alpine/v${ALPINE_VERSION}/community" >> /etc/apk/repositories && \ echo "https://dl.bintray.com/php-alpine/v${ALPINE_VERSION}/php-${PHP_VERSION}" >> /etc/apk/repositories -RUN apk add --update \ +RUN apk add --update-cache \ php \ php-mbstring # START WITH BASH. -CMD ["/bin/bash"] \ No newline at end of file +CMD ["/bin/bash"] diff --git a/sandbox/Dockerfile b/sandbox/Dockerfile index cff52fed..908ab640 100644 --- a/sandbox/Dockerfile +++ b/sandbox/Dockerfile @@ -17,7 +17,7 @@ ARG APK_PACKAGER ARG APK_MAINTAINER # ADD SDK AND BASIC TOOLS. -RUN apk add --update alpine-sdk sudo git bash nano +RUN apk add --update-cache alpine-sdk sudo git bash nano # CONFIGURE ALPINE REPOSITORIES AND PHP BUILD DIR. RUN echo "http://dl-cdn.alpinelinux.org/alpine/v${ALPINE_VERSION}/main" > /etc/apk/repositories && \ @@ -65,4 +65,4 @@ ENTRYPOINT ["/bin/start.sh"] WORKDIR "/home/sandbox/php-${PHP_VERSION}" # START WITH BASH. -CMD ["/bin/bash"] \ No newline at end of file +CMD ["/bin/bash"]