-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
adding VOLUME command #62
adding VOLUME command #62
Conversation
@@ -0,0 +1,12 @@ | |||
[ | |||
{ | |||
"Image1": "gcr.io/sharif-test/docker-test-volume:latest", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: kbuild-test
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed.
pkg/commands/commands.go
Outdated
@@ -54,6 +54,8 @@ func GetCommand(cmd instructions.Command, buildcontext string) (DockerCommand, e | |||
return &LabelCommand{cmd: c}, nil | |||
case *instructions.UserCommand: | |||
return &UserCommand{cmd: c}, nil | |||
case *instructions.VolumeCommand: | |||
return &VolumeCommand{cmd: c, buildcontext: buildcontext}, nil |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Where is the buildcontext used?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's not, I'm getting rid of it.
pkg/commands/volume.go
Outdated
// Create any directories that don't already exist | ||
destVolume := volume | ||
logrus.Infof("Creating directory %s", destVolume) | ||
if err := os.MkdirAll(destVolume, 0755); err != nil { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So I think you actually don't have to create the volume if it doesn't exist, it looks like you just have to add it to the config and then docker mounts it during "docker run". That might explain why container-diff isn't finding certain directories in the docker built version of the test.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well that makes my life easy. Will fix.
I'm now adding volume mounted directories to our whitelist, but this causes RUN commands to fail rather than ignore them. Is that intended? |
Oh yah I think RUN commands should still be able to execute, we just shouldn't snapshot any changes made in volume mounted directories. If we create the directory but also add it to the whitelist this should work |
Yep, verified that that's how it works and added a test for it. |
…-builder into volume-cmd
…-builder into volume-cmd
…-builder into volume-cmd
…uilder into volume-cmd
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm!
No description provided.