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

dgoss: Fix cp strategy for existing /goss folder #399

Merged
merged 1 commit into from Dec 28, 2018

Conversation

Projects
None yet
2 participants
@ppmathis
Copy link
Contributor

ppmathis commented Nov 4, 2018

When using dgoss with the 'cp' strategy and a container image which already contains the '/goss' directory, the docker cp command copies the local goss folder to '/goss/goss' instead of copying the contents into '/goss'.

As preserving existing directory contents within the container can be interesting (e.g. generating goss vars during build time), this commit fixes dgoss to use docker cp srcdir/. destdir instead of docker cp srcdir destdir - note the difference of the trailing slash and dot.

The exact behavior of the Docker cp command can be found at: https://docs.docker.com/engine/reference/commandline/cp/#extended-description

- SRC_PATH specifies a directory
  - DEST_PATH exists and is a directory
    - SRC_PATH does not end with /. (that is: slash followed by dot)
      the source directory is copied into this directory
    - SRC_PATH does end with /. (that is: slash followed by dot)
      the content of the source directory is copied into this directory
dgoss: Fix cp strategy for existing /goss folder
When using dgoss with the 'cp' strategy and a container image which
already contains the '/goss' directory, the `docker cp` command copies
the local goss folder to '/goss/goss' instead of copying the contents
into '/goss'.

As preserving existing directory contents within the container can be
interesting (e.g. generating goss vars during build time), this commit
fixes dgoss to use `docker cp srcdir/. destdir` instead of `docker cp
srcdir destdir` - note the difference of the trailing slash and dot.

The exact behavior of the Docker cp command can be found at:
https://docs.docker.com/engine/reference/commandline/cp/#extended-description

Signed-off-by: Pascal Mathis <mail@pascalmathis.com>

@aelsabbahy aelsabbahy merged commit 73a2eaf into aelsabbahy:master Dec 28, 2018

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment