Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions docker.Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ binary: build_binary_native_image ## build the CLI
build: binary ## alias for binary

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


.PHONY: clean
clean: build_docker_image ## clean build artifacts
Expand All @@ -87,15 +87,15 @@ binary-windows: build_cross_image ## build the CLI for Windows

.PHONY: plugins-windows
plugins-windows: build_cross_image ## build the example CLI plugins for Windows
docker run --rm $(ENVVARS) $(MOUNTS) $(CROSS_IMAGE_NAME) make $@
docker run --rm $(ENVVARS) $(DOCKER_CLI_MOUNTS) $(CROSS_IMAGE_NAME) make $@

.PHONY: binary-osx
binary-osx: build_cross_image ## build the CLI for macOS
$(DOCKER_RUN) $(CROSS_IMAGE_NAME) make $@

.PHONY: plugins-osx
plugins-osx: build_cross_image ## build the example CLI plugins for macOS
docker run --rm $(ENVVARS) $(MOUNTS) $(CROSS_IMAGE_NAME) make $@
docker run --rm $(ENVVARS) $(DOCKER_CLI_MOUNTS) $(CROSS_IMAGE_NAME) make $@

.PHONY: dev
dev: build_docker_image ## start a build container in interactive mode for in-container development
Expand Down