Fixed merge conflict from master

This commit is contained in:
Priya Wadhwa
2018-04-02 13:05:22 -07:00
27 changed files with 1062 additions and 58 deletions
@@ -12,3 +12,9 @@ COPY ["context/foo", "/tmp/foo" ]
COPY context/b* /baz/
COPY context/foo context/bar/ba? /test/
COPY context/arr[[]0].txt /mydir/
COPY context/bar/bat .
ENV contextenv ./context
COPY ${contextenv}/foo /tmp/foo2
COPY $contextenv/foo /tmp/foo3
COPY $contextenv/* /tmp/${contextenv}/
@@ -0,0 +1,7 @@
FROM gcr.io/distroless/base:latest
CMD ["command", "one"]
CMD ["command", "two"]
CMD echo "hello"
ENTRYPOINT ["execute", "something"]
ENTRYPOINT ["execute", "entrypoint"]
@@ -0,0 +1,19 @@
# Copyright 2018 Google, Inc. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
FROM gcr.io/google-appengine/debian9
RUN useradd testuser
RUN groupadd testgroup
USER testuser:testgroup
RUN echo "hey" > /tmp/foo
@@ -0,0 +1,13 @@
FROM gcr.io/google-appengine/debian9:latest
COPY context/foo foo
WORKDIR /test
# Test that this will be appended on to the previous command, to create /test/workdir
WORKDIR workdir
COPY context/foo ./currentfoo
# Test that the RUN command will happen in the correct directory
RUN cp currentfoo newfoo
WORKDIR /new/dir
ENV dir /another/new/dir
WORKDIR $dir/newdir
WORKDIR $dir/$doesntexist
WORKDIR /
@@ -0,0 +1,12 @@
[
{
"Image1": "gcr.io/kbuild-test/docker-test-workdir:latest",
"Image2": "gcr.io/kbuild-test/kbuild-test-workdir:latest",
"DiffType": "File",
"Diff": {
"Adds": null,
"Dels": null,
"Mods": null
}
}
]
@@ -0,0 +1,4 @@
schemaVersion: '2.0.0'
metadataTest:
cmd: ["/bin/sh", "-c", "echo \"hello\""]
entrypoint: ["execute", "entrypoint"]
@@ -0,0 +1,15 @@
schemaVersion: '2.0.0'
commandTests:
- name: 'whoami'
command: 'whoami'
expectedOutput: ['testuser']
excludedOutput: ['root']
- name: 'file owner'
command: 'ls'
args: ['-l', '/tmp/foo']
expectedOutput: ['.*testuser.*', '.*testgroup.*']
excludedOutput: ['.*root.*']
fileContentTests:
- name: "/tmp/foo"
path: "/tmp/foo"
expectedContent: ["hey"]
@@ -87,6 +87,14 @@ var fileTests = []struct {
kbuildContextBucket: true,
repo: "test-bucket-buildcontext",
},
{
description: "test workdir",
dockerfilePath: "/workspace/integration_tests/dockerfiles/Dockerfile_test_workdir",
configPath: "/workspace/integration_tests/dockerfiles/config_test_workdir.json",
dockerContext: buildcontextPath,
kbuildContext: buildcontextPath,
repo: "test-workdir",
},
}
var structureTests = []struct {
@@ -105,6 +113,22 @@ var structureTests = []struct {
kbuildContext: dockerfilesPath,
structureTestYamlPath: "/workspace/integration_tests/dockerfiles/test_env.yaml",
},
{
description: "test metadata",
dockerfilePath: "/workspace/integration_tests/dockerfiles/Dockerfile_test_metadata",
repo: "test-metadata",
dockerBuildContext: dockerfilesPath,
kbuildContext: dockerfilesPath,
structureTestYamlPath: "/workspace/integration_tests/dockerfiles/test_metadata.yaml",
},
{
description: "test user command",
dockerfilePath: "/workspace/integration_tests/dockerfiles/Dockerfile_test_user_run",
repo: "test-user",
dockerBuildContext: dockerfilesPath,
kbuildContext: dockerfilesPath,
structureTestYamlPath: "/workspace/integration_tests/dockerfiles/test_user.yaml",
},
}
type step struct {