diff options
author | Tyler Cipriani <tcipriani@wikimedia.org> | 2018-07-19 10:26:20 -0600 |
---|---|---|
committer | Tyler Cipriani <tcipriani@wikimedia.org> | 2018-07-26 11:20:28 -0600 |
commit | aba163aa5a762a497a5b7a0f1a43fb756c916d64 (patch) | |
tree | bd213d500e72a2a74f69f2fdc38756f4c1adc41e /docker | |
parent | 2b87c9a345da18ed408fd0d031068beb0c46adff (diff) | |
download | blubber-aba163aa5a762a497a5b7a0f1a43fb756c916d64.tar.gz |
Add slash to directory path if copying > 1 file
Summary:
Ran into a Docker error when attempting to build a node project with
more than one requirements files:
When using COPY with more than one source file, the destination must
be a directory and end with a /
Reviewers: dduvall, #release-engineering-team
Reviewed By: dduvall, #release-engineering-team
Tags: #release-engineering-team
Differential Revision: https://phabricator.wikimedia.org/D1080
Diffstat (limited to 'docker')
-rw-r--r-- | docker/instructions_test.go | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/docker/instructions_test.go b/docker/instructions_test.go index 07b71c7..9bdbeb1 100644 --- a/docker/instructions_test.go +++ b/docker/instructions_test.go @@ -37,7 +37,7 @@ func TestCopy(t *testing.T) { di, err := docker.NewInstruction(i) if assert.NoError(t, err) { - assert.Equal(t, "COPY [\"foo1\", \"foo2\", \"bar\"]\n", di.Compile()) + assert.Equal(t, "COPY [\"foo1\", \"foo2\", \"bar/\"]\n", di.Compile()) } } @@ -48,7 +48,7 @@ func TestCopyAs(t *testing.T) { di, err := docker.NewInstruction(i) if assert.NoError(t, err) { - assert.Equal(t, "COPY --chown=123:124 [\"foo1\", \"foo2\", \"bar\"]\n", di.Compile()) + assert.Equal(t, "COPY --chown=123:124 [\"foo1\", \"foo2\", \"bar/\"]\n", di.Compile()) } }) @@ -58,7 +58,7 @@ func TestCopyAs(t *testing.T) { di, err := docker.NewInstruction(i) if assert.NoError(t, err) { - assert.Equal(t, "COPY --chown=123:124 --from=foo [\"foo1\", \"foo2\", \"bar\"]\n", di.Compile()) + assert.Equal(t, "COPY --chown=123:124 --from=foo [\"foo1\", \"foo2\", \"bar/\"]\n", di.Compile()) } }) } @@ -69,7 +69,7 @@ func TestCopyFrom(t *testing.T) { di, err := docker.NewInstruction(i) if assert.NoError(t, err) { - assert.Equal(t, "COPY --from=foo [\"foo1\", \"foo2\", \"bar\"]\n", di.Compile()) + assert.Equal(t, "COPY --from=foo [\"foo1\", \"foo2\", \"bar/\"]\n", di.Compile()) } } @@ -149,7 +149,7 @@ func TestEscapeCopy(t *testing.T) { di, err := docker.NewInstruction(i) if assert.NoError(t, err) { - assert.Equal(t, "COPY [\"file.a\", \"file.b\", \"dest\"]\n", di.Compile()) + assert.Equal(t, "COPY [\"file.a\", \"file.b\", \"dest/\"]\n", di.Compile()) } } |