Thanks to visit codestin.com
Credit goes to github.com

Skip to content

ENH: Add Makefile for local development testing of build #8

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

matthewfeickert
Copy link
Contributor

Resolves #7

Add a very simple Makefile for local development testing to build the image. This allows for using

make

to build the image and

make run

to drop into an interactive session in the image.

This should wait for PR #6 to get merged so that this can be rebased and add in build args.


run:
docker run --rm -it \
-v $(shell pwd):/mpl_source \
Copy link
Member

Choose a reason for hiding this comment

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

But you should be mounting the Matplotlib source, not this directory.

Copy link
Contributor Author

@matthewfeickert matthewfeickert Jul 11, 2020

Choose a reason for hiding this comment

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

No, not for testing the build of this image.

Copy link
Member

Choose a reason for hiding this comment

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

There's nothing in this repo to test with.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The Makefile is local to this project. What I mean is that if you're working on refactoring the image and you want to build things locally and then drop into it to look around and play then this Make target is helpful. For use in actually doing things in matplotlib that's a different story. But what @tacaswell is demoing in PR #5 wouldn't ever be using this Makefile. That would need some shell alias or something.

Sorry, I may have a different idea in my head about what the intended use case of this specific repository is. I thought that this was for just developing the Docker image for a canonical matplotlib build/dev environment. Am I on the same train of thought as you, or did I get confused?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

oh sorry! I think that my choice of mpl_source is confusing here(?). I know that this doesn't contain the matplotlib source code, but just thought that as this would be used for matplotlib source that I'd hint at what this image would be used for. If this is bad I'll change it.

@matthewfeickert
Copy link
Contributor Author

As @tacaswell has pointed out, graphical forwarding is needed so I'll need to add in additional bind mounting to the example run Make target. That will need

-v /tmp/.X11-unix/:/tmp/.X11-unix/

but environment DISPLAY also need to get properly exported with -e. I've forgotten how to properly do this, so I'll need to go look at things.

This allows for the user's current working directory to get bind mounted
into the container at /mpl_source and also to have the working directory
get set to /mpl_source so they are ready to go
Additionally, as a style change use BASE_IMAGE instead of BUILDER_IMAGE.
This is due to Matthew pasting in some code from a multistage Docker
build project, but BUILDER makes little sense here, so use a better
naming.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add a Makefile for easier local testing of image build during development
2 participants