Skip to content
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

Allow custom file names #102

Closed
yajo opened this issue Jul 21, 2017 · 9 comments · Fixed by #1825
Closed

Allow custom file names #102

yajo opened this issue Jul 21, 2017 · 9 comments · Fixed by #1825
Assignees
Milestone

Comments

@yajo
Copy link

yajo commented Jul 21, 2017

Right now, COMPOSE_FILE_GLOB_PATTERN and DOCKERFILE_GLOB_PATTERN are hardcoded patterns.

We'd need a way to configure those, either by user or by project.

Thanks!

@chrisdias
Copy link
Member

would a free form text entry be sufficient?

or, the ability to right click on any file to build (today the context menu only shows for files that match these patterns):

image

@yajo
Copy link
Author

yajo commented Jul 24, 2017

Just now I tried on this project and right-clicking on any of the dockerfiles there shows that menu item, although running Docker: Build from the command palette only shows the main Dockerfile. I think the DOCKERFILE_GLOB_PATTERN should be more like *.Dockerfile,Dockerfile.* (not sure if that's the syntax, but you get it), or simply let vscode detect those, since it does it pretty well.

I also tried on this another project where we have 5 valid docker-compose files (although common.yaml shouldn't be used by itself) and none matches this module's regexps. You can't use any docker-compose features from this module (unless you symlink any of those with the right names). Also I don't think those file names should be treated by default as docker-compose files, because they are very project-specific, but it would be perfect to be able to have a setting that lets the project define its environments, like being able to add to ./.vscode/config.json:

{
    "docker.compose.fileGlobs": ["*.yaml"]
}

@chrisdias
Copy link
Member

👍 on the idea of settings to override the glob patterns.

@robertpeteuil
Copy link

I agree with the requests to allow changing the globs.

Can docker-compose be added as an available language? At least this would allow manually selecting it when working with a "unique-named" docker-compose file.

@rodrigodiez
Copy link

Would also love to see this implemented. I have some Golang repositories with multiple binaries and I'd like to have a Dockerfile for each of them. Unfortunately at the moment I have to manage the build manually because these Docker files are not recognized

@StephenWeatherford
Copy link
Contributor

@rodrigodiez Please not that you can in fact do this already for Dockerfiles (but not compose files) - see #248 (comment):

{
"files.associations": {
"Dockerfile*": "dockerfile"
}
}

@crstamps2
Copy link

@StephenWeatherford while the association is a great start for syntax highlighting and such, the commands provided to vscode do not work. An error is given that it cannot find any Dockerfile in the work space.

@StephenWeatherford
Copy link
Contributor

@crstamps2 Thanks, will see if there's anything we can do.

@bwateratmsft
Copy link
Collaborator

To recap since this has been around a while--the files.associations setting helps by adding syntax highlighting, but the extension commands (e.g. "Compose Up", "Build Docker Image", etc.) do not recognize all docker-compose YML files and Dockerfiles. It would require code changes for these commands to work; in particular settings for controlling the glob patterns would work.

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