From 12205037c16908c2ce1dd84cd87ba7672fa2a592 Mon Sep 17 00:00:00 2001 From: "jesus m. rodriguez" Date: Tue, 2 Feb 2021 19:37:48 -0500 Subject: [PATCH] *: Replace 'docker build . -t ${IMG}' with '-t ${IMG} .' Because folks may have 'docker' aliased to 'podman', and Podman prefers options before positional arguments: $ podman build --help | grep CONTEXT-DIRECTORY podman build [command options] CONTEXT-DIRECTORY | URL We can't change the v2 sample since it still uses the old format. Co-authored-by: W. Trevor King Signed-off-by: jesus m. rodriguez --- changelog/fragments/reorder-docker-args.yaml | 28 +++++++++++++++++++ .../scaffolds/internal/templates/makefile.go | 2 +- .../scaffolds/internal/templates/makefile.go | 2 +- testdata/ansible/memcached-operator/Makefile | 2 +- testdata/helm/memcached-operator/Makefile | 2 +- 5 files changed, 32 insertions(+), 4 deletions(-) create mode 100644 changelog/fragments/reorder-docker-args.yaml diff --git a/changelog/fragments/reorder-docker-args.yaml b/changelog/fragments/reorder-docker-args.yaml new file mode 100644 index 0000000000..aacf029b7f --- /dev/null +++ b/changelog/fragments/reorder-docker-args.yaml @@ -0,0 +1,28 @@ +# entries is a list of entries to include in +# release notes and/or the migration guide +entries: + - description: > + (ansible/v1, helm/v1) Post-fixed positional directory argument `.` in `docker-build` make target to align with `podman` + kind: "change" + breaking: false + + # Migration can be defined to automatically add a section to + # the migration guide. This is required for breaking changes. + migration: + header: Move positional directory argument `.` in `docker-build` make target + body: > + The directory argument `.` in the `docker-build` make target was moved to the + last positional argument to align with `podman`'s expectations, making substitution + cleaner. In your `Makefile`, change: + + docker build . -t ${IMG} + + to + docker build -t ${IMG} . + + Alternatively, you could replace it programmatically + + ```sh + sed -i 's/docker build . -t ${IMG}/docker build -t ${IMG} ./' $(git grep -l 'docker.*build \. ') + ``` + diff --git a/internal/plugins/ansible/v1/scaffolds/internal/templates/makefile.go b/internal/plugins/ansible/v1/scaffolds/internal/templates/makefile.go index fcf32617f4..f5a4c6c2b3 100644 --- a/internal/plugins/ansible/v1/scaffolds/internal/templates/makefile.go +++ b/internal/plugins/ansible/v1/scaffolds/internal/templates/makefile.go @@ -93,7 +93,7 @@ undeploy: kustomize # Build the docker image docker-build: - docker build . -t ${IMG} + docker build -t ${IMG} . # Push the docker image docker-push: diff --git a/internal/plugins/helm/v1/scaffolds/internal/templates/makefile.go b/internal/plugins/helm/v1/scaffolds/internal/templates/makefile.go index c530b16970..7fa3fa3a75 100644 --- a/internal/plugins/helm/v1/scaffolds/internal/templates/makefile.go +++ b/internal/plugins/helm/v1/scaffolds/internal/templates/makefile.go @@ -93,7 +93,7 @@ undeploy: kustomize # Build the docker image docker-build: - docker build . -t ${IMG} + docker build -t ${IMG} . # Push the docker image docker-push: diff --git a/testdata/ansible/memcached-operator/Makefile b/testdata/ansible/memcached-operator/Makefile index f667456f0f..8a74f8d6f4 100644 --- a/testdata/ansible/memcached-operator/Makefile +++ b/testdata/ansible/memcached-operator/Makefile @@ -56,7 +56,7 @@ undeploy: kustomize # Build the docker image docker-build: - docker build . -t ${IMG} + docker build -t ${IMG} . # Push the docker image docker-push: diff --git a/testdata/helm/memcached-operator/Makefile b/testdata/helm/memcached-operator/Makefile index a23f8fca9e..4d3c17c7ec 100644 --- a/testdata/helm/memcached-operator/Makefile +++ b/testdata/helm/memcached-operator/Makefile @@ -56,7 +56,7 @@ undeploy: kustomize # Build the docker image docker-build: - docker build . -t ${IMG} + docker build -t ${IMG} . # Push the docker image docker-push: