mirror of
https://github.com/hadolint/hadolint.git
synced 2025-12-17 03:24:08 +00:00
Page:
DL3019
Pages
DL3000
DL3001
DL3002
DL3003
DL3004
DL3005
DL3006
DL3007
DL3008
DL3009
DL3010
DL3011
DL3012
DL3013
DL3014
DL3015
DL3016
DL3017
DL3018
DL3019
DL3020
DL3021
DL3022
DL3023
DL3024
DL3025
DL3026
DL3027
DL3028
DL3029
DL3030
DL3031
DL3032
DL3033
DL3034
DL3035
DL3036
DL3037
DL3038
DL3039
DL3040
DL3041
DL3042
DL3043
DL3044
DL3045
DL3046
DL3047
DL3048
DL3049
DL3050
DL3051
DL3052
DL3053
DL3054
DL3055
DL3056
DL3057
DL3058
DL3059
DL3060
DL3061
DL3062
DL4000
DL4001
DL4003
DL4004
DL4005
DL4006
Home
SC2046
SC2086
Template
No results
1
DL3019
Vlastimil Zeman edited this page 2017-12-13 09:53:53 +00:00
Table of Contents
Use the --no-cache switch
Problematic code:
FROM alpine:3.7
RUN apk update \
&& apk add foo=1.0 \
&& rm -rf /var/cache/apk/*
FROM alpine:3.7
RUN apk add --update foo=1.0
&& rm -rf /var/cache/apk/*
Correct code:
FROM alpine:3.7
RUN apk --no-cache add foo=1.0
Rationale:
As of Alpine Linux 3.3 there exists a new --no-cache option for apk. It allows users to install packages with an index that is updated and used on-the-fly and not cached locally:
This avoids the need to use --update and remove /var/cache/apk/* when done installing packages.
inspired by https://github.com/gliderlabs/docker-alpine/blob/master/docs/usage.md#disabling-cache