Skip to content

Commit

Permalink
Don't read files from current working directory
Browse files Browse the repository at this point in the history
Issue: 365150653
Reviewed-on: #4656
  • Loading branch information
dahlstrom-g committed Jan 8, 2025
1 parent f1505ad commit cbd0f25
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 7 deletions.
1 change: 0 additions & 1 deletion cobalt/devinfra/kokoro/bin/dind_builder_runner.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ set -ueEx

# Using repository root as work directory.
export WORKSPACE_COBALT="${KOKORO_ARTIFACTS_DIR}/git/src"
cd "${WORKSPACE_COBALT}"

# Clean up workspace on exit or error.
trap "bash ${WORKSPACE_COBALT}/cobalt/devinfra/kokoro/bin/cleanup.sh" EXIT INT TERM
Expand Down
6 changes: 2 additions & 4 deletions cobalt/devinfra/kokoro/bin/dind_py/dind_common.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ def push_image(target_image):
utils.exec_cmd(command)


def get_local_image_name(service, compose_file='docker-compose.yaml'):
def get_local_image_name(service, compose_file):
"""
Parses the docker-compose file to determine the image-name from the
service-name. When the compose-file is used to build the image, it will get
Expand All @@ -86,9 +86,7 @@ def tag_image(src_img, dest_img):
utils.exec_cmd(tag_command)


def run_docker_build(platform,
target_image,
compose_file='docker-compose.yaml'):
def run_docker_build(platform, target_image, compose_file):
"""
Runs the docker build for the provided platform, and tags the newly built
image with the registry/image/tag arguments. If the build fails, instead it
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,8 @@ def main():
utils.logging_info_spacer('Building Docker Image')
build_start_time = time.time()
try:
dind.run_docker_build(args.platform, target_image)
dind.run_docker_build(args.platform, target_image,
args.src_root + '/docker-compose.yaml')
dind.tag_image(target_image, floating_image)
dind.push_image(floating_image)
docker_build_duration = time.time() - build_start_time
Expand Down
1 change: 0 additions & 1 deletion cobalt/devinfra/kokoro/bin/dind_runner.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ set -ueEx

# Using repository root as work directory.
export WORKSPACE_COBALT="${KOKORO_ARTIFACTS_DIR}/git/src"
cd "${WORKSPACE_COBALT}"

# Clean up workspace on exit or error.
trap "bash ${WORKSPACE_COBALT}/cobalt/devinfra/kokoro/bin/cleanup.sh" EXIT INT TERM
Expand Down

0 comments on commit cbd0f25

Please sign in to comment.