Added a KanikoStage type for each stage of a Dockerfile

I added a KanikoStage to hold each stage of the Dockerfile along with
information about each stage that would be useful later on.

The new KanikoStage type holds the stage itself, along with some
additional information:

1. FinalStage -- whether the current stage is the final stage
2. BaseImageStoredLocally/BaseImageIndex -- whether the base image for
this stage is stored locally, and if so what the index of the base image
is
3. SaveStage -- whether this stage needs to be saved for use in a future
stage

This is the first part of a larger refactor for building stages, which
will later make it easier to add layer caching.
This commit is contained in:
Priya Wadhwa
2018-08-27 14:15:04 -07:00
parent 360390056c
commit 64a0b1d75f
11 changed files with 231 additions and 115 deletions
+2 -2
View File
@@ -22,9 +22,9 @@ import (
"strings"
"github.com/GoogleContainerTools/kaniko/pkg/buildcontext"
"github.com/GoogleContainerTools/kaniko/pkg/config"
"github.com/GoogleContainerTools/kaniko/pkg/constants"
"github.com/GoogleContainerTools/kaniko/pkg/executor"
"github.com/GoogleContainerTools/kaniko/pkg/options"
"github.com/GoogleContainerTools/kaniko/pkg/util"
"github.com/genuinetools/amicontained/container"
"github.com/pkg/errors"
@@ -33,7 +33,7 @@ import (
)
var (
opts = &options.KanikoOptions{}
opts = &config.KanikoOptions{}
logLevel string
force bool
)