Skip to content

Docker build arg #27

Description

@dodopontocom

Hello Team,
I am trying to use lib for docker build and push, but I am getting the following error.
I understand by the documentation that "build-args" are optional, so I dont use them.
Important: I noticed two empty single quotes in the error message, the place that build-arg suppose to be

But I am getting the following error

Reproducing the error:
my_script.sh

#!/bin/bash

do.use gcp.gcr

echo ${DODRONES_GCP_MY_LABS_SA} > ${GCLOUD_JSON_KEY_PATH}

gcp.gcr.buildAndPublish "${GCLOUD_PROJECT_ID}" "${ROOT_DIR}/" \
        "Dockerfile" "web-site"

ERROR:

+ docker build -t us.gcr.io/terraform-gcp-lab/web-site:latest -f Dockerfile '' /home/rodolfo/git/web-site/
"docker build" requires exactly 1 argument.
See 'docker build --help'.

Usage:  docker build [OPTIONS] PATH | URL | -

Build an image from a Dockerfile
ERROR:  It was not possible to build docker image 'us.gcr.io/terraform-gcp-lab/web-site:latest'
        Exiting (1)...

Using a build arg it WORKED:

docker build -t "${DOCKER_IMAGE_TAG_LATEST}" -f "${_docker_file}" "${_docker_build_args[@]}" "${_docker_dir}" "--no-cache"

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions