drop uncacheable commands
This commit is contained in:
parent
603a542f27
commit
41a97540eb
|
|
@ -18,5 +18,3 @@
|
||||||
|
|
||||||
FROM debian:10.13
|
FROM debian:10.13
|
||||||
RUN date > /date
|
RUN date > /date
|
||||||
COPY context/foo /foo
|
|
||||||
RUN echo hey
|
|
||||||
|
|
|
||||||
|
|
@ -17,7 +17,7 @@
|
||||||
# if the cache is implemented correctly
|
# if the cache is implemented correctly
|
||||||
|
|
||||||
FROM debian:10.13
|
FROM debian:10.13
|
||||||
|
RUN mkdir /foo
|
||||||
WORKDIR /foo
|
WORKDIR /foo
|
||||||
RUN apt-get update && apt-get install -y make
|
RUN apt-get update && apt-get install -y make
|
||||||
COPY context/bar /context
|
|
||||||
RUN echo "hey" > foo
|
RUN echo "hey" > foo
|
||||||
|
|
|
||||||
|
|
@ -17,7 +17,7 @@
|
||||||
# if the cache is implemented correctly
|
# if the cache is implemented correctly
|
||||||
|
|
||||||
FROM debian:10.13
|
FROM debian:10.13
|
||||||
|
RUN mkdir /foo
|
||||||
WORKDIR /foo
|
WORKDIR /foo
|
||||||
RUN apt-get update && apt-get install -y make
|
RUN apt-get update && apt-get install -y make
|
||||||
COPY context/bar /context
|
|
||||||
RUN echo "hey" > foo
|
RUN echo "hey" > foo
|
||||||
|
|
|
||||||
|
|
@ -18,5 +18,3 @@
|
||||||
|
|
||||||
FROM debian:10.13
|
FROM debian:10.13
|
||||||
RUN date > /date
|
RUN date > /date
|
||||||
COPY context/foo /foo
|
|
||||||
RUN echo hey
|
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,9 @@
|
||||||
|
FROM ubuntu AS base
|
||||||
|
|
||||||
|
# Creates cache misses on main@1d2bff5:
|
||||||
|
# Even with --cache-copy-layers, only COPY layers are cached.
|
||||||
|
# ADD instruction is never cached.
|
||||||
|
# As a workaround use COPY instruction instead
|
||||||
|
#
|
||||||
|
# COPY context/foo foo
|
||||||
|
ADD context/foo foo
|
||||||
|
|
@ -0,0 +1,9 @@
|
||||||
|
FROM ubuntu AS base
|
||||||
|
|
||||||
|
# Creates cache misses on main@1d2bff5:
|
||||||
|
# When building the image directly no layer is created.
|
||||||
|
# When rebuilding from cache a layer is emitted even for empty statements,
|
||||||
|
# as we currently have no logic for skipping the layer when rebuilding from emtpy cache.
|
||||||
|
# This causes one-time cache misses as now the chain of layers has changed.
|
||||||
|
#
|
||||||
|
RUN echo blubb
|
||||||
|
|
@ -0,0 +1,8 @@
|
||||||
|
FROM ubuntu
|
||||||
|
|
||||||
|
# Creates cache misses on main@1d2bff5 before #3340:
|
||||||
|
# Folders created implicitly by WORKDIR are not cached.
|
||||||
|
# As a workaround create them excplicitly with RUN
|
||||||
|
#
|
||||||
|
# RUN mkdir /app
|
||||||
|
WORKDIR /app
|
||||||
|
|
@ -218,6 +218,12 @@ func NewDockerFileBuilder() *DockerFileBuilder {
|
||||||
"Dockerfile_test_cache_install": {},
|
"Dockerfile_test_cache_install": {},
|
||||||
"Dockerfile_test_cache_perm": {},
|
"Dockerfile_test_cache_perm": {},
|
||||||
"Dockerfile_test_cache_copy": {},
|
"Dockerfile_test_cache_copy": {},
|
||||||
|
// TODO: WORKDIR command is uncacheable
|
||||||
|
//"Dockerfile_test_issue_workdir": {},
|
||||||
|
// TODO: ADD command is uncacheable
|
||||||
|
//"Dockerfile_test_issue_add": {},
|
||||||
|
// TODO: Empty Layers are uncacheable
|
||||||
|
//"Dockerfile_test_issue_empty": {},
|
||||||
}
|
}
|
||||||
d.TestOCICacheDockerfiles = map[string]struct{}{
|
d.TestOCICacheDockerfiles = map[string]struct{}{
|
||||||
"Dockerfile_test_cache_oci": {},
|
"Dockerfile_test_cache_oci": {},
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue