Skip to content

Fix unknown $(MOUNTS) variable in makefile plugins target#1698

Merged
thaJeztah merged 1 commit intodocker:masterfrom
silvin-lubecki:fix-cross-dev-mounts
Mar 1, 2019
Merged

Fix unknown $(MOUNTS) variable in makefile plugins target#1698
thaJeztah merged 1 commit intodocker:masterfrom
silvin-lubecki:fix-cross-dev-mounts

Conversation

@silvin-lubecki
Copy link
Contributor

- What I did
Mounts were broken for plugins as #1511 replaced $(MOUNTS) by $(DOCKER_CLI_MOUNTS).

- A picture of a cute animal (not mandatory but encouraged)
image

Signed-off-by: Silvin Lubecki <silvin.lubecki@docker.com>
@codecov-io
Copy link

Codecov Report

Merging #1698 into master will decrease coverage by <.01%.
The diff coverage is n/a.

@@            Coverage Diff             @@
##           master    #1698      +/-   ##
==========================================
- Coverage   56.12%   56.12%   -0.01%     
==========================================
  Files         306      306              
  Lines       21030    21025       -5     
==========================================
- Hits        11803    11800       -3     
+ Misses       8373     8371       -2     
  Partials      854      854


plugins: build_binary_native_image ## build the CLI plugin examples
docker run --rm $(ENVVARS) $(MOUNTS) $(BINARY_NATIVE_IMAGE_NAME) ./scripts/build/plugins
docker run --rm $(ENVVARS) $(DOCKER_CLI_MOUNTS) $(BINARY_NATIVE_IMAGE_NAME) ./scripts/build/plugins
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could we do the reverse, and remove the DOCKER_CLI_ prefix from all of these? This is the makefile for the CLI repository, so not sure why we need the prefix

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I also noticed the $DOCKER_CLI_SHELL variable was added; alpine images now have /bin/sh set by default (previously they didn't, which was perhaps the reason this argument was added), but we install bash as well @wk8 was that variable added to switch to bash? If so, perhaps we should update the Dockerfile, and make it the default?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@thaJeztah the DOCKER_CLI prefix is for the variables which can be overriden with env variables. Allows setting them in eg a shell profile (and that's also why they are nicely set apart - https://github.com/wk8/cli/blob/2178fea84dbea0b278d412b5f9cf16e3542d2650/docker.Makefile#L7-L11)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

shouldn't those be set after make though?

make FOO=bar BAR=baz <target>

Copy link
Contributor

@wk8 wk8 Feb 28, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's one way to do it but

export FOO=bar
make <target>

or

FOO=bar make <target>

work just the same. (It's just a feature of make to parse env-variables-like arguments as such).

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As to $DOCKER_CLI_SHELL, yup I've set mine to bash --login so that it also loads my shell profile - just made it ash in #1511 to make the change seamless, but I don't any reason why we couldn't switch to bash.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd be +1 to change it to bash by default, but we could do that separate

@wk8
Copy link
Contributor

wk8 commented Feb 28, 2019

Ooops. Sorry. In my defense the plugin* targets were added some time after I made #1511, and that wasn't caught as no conflicts. Apologies!

Copy link
Contributor

@wk8 wk8 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for fixing!

Copy link
Member

@thaJeztah thaJeztah left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@thaJeztah thaJeztah merged commit ee94f72 into docker:master Mar 1, 2019
@GordonTheTurtle GordonTheTurtle added this to the 19.03.0 milestone Mar 1, 2019
ijc pushed a commit to ijc/docker-cli that referenced this pull request Mar 4, 2019
Seems I rebased over b039db9 ("Make it possible to override the volume
mounts and shell for the dev container") at some point and failed to notice
that some of the variable names had changed.

In the meantime the underlying issue was fixed in docker#1698 but here we switch to
using `$(DOCKER_RUN)`. This means that these rules now use
`$(DOCKER_RUN_NAME_OPTION)` and thus obey the `$(DOCKER_CLI_CONTAINER_NAME)`
variable.

Signed-off-by: Ian Campbell <ijc@docker.com>
@ijc ijc mentioned this pull request Mar 4, 2019
@silvin-lubecki silvin-lubecki deleted the fix-cross-dev-mounts branch April 1, 2019 12:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants