llb: add const for root mount

Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
docker-18.09
Tonis Tiigi 2017-07-10 21:54:38 -07:00
parent 2bb4c5d487
commit bcb950915b
3 changed files with 6 additions and 2 deletions

View File

@ -3,6 +3,7 @@ package llb
import (
_ "crypto/sha256"
"github.com/moby/buildkit/solver/pb"
digest "github.com/opencontainers/go-digest"
"github.com/pkg/errors"
)
@ -48,7 +49,7 @@ func (s *State) Run(opts ...RunOption) *ExecState {
meta: meta,
mounts: []*mount{},
root: &mount{
dest: "/",
dest: pb.RootMount,
source: s.source,
parent: s.mount,
hasOutput: true,

View File

@ -85,7 +85,7 @@ func (e *execOp) Run(ctx context.Context, inputs []Reference) ([]Reference, erro
outputs = append(outputs, active)
mountable = active
}
if m.Dest == "/" {
if m.Dest == pb.RootMount {
root = mountable
} else {
mounts = append(mounts, worker.Mount{Src: mountable, Dest: m.Dest})

3
solver/pb/const.go Normal file
View File

@ -0,0 +1,3 @@
package pb
const RootMount = "/"