hashicorp / hashicorp/vagrant

vagrant docker-exec should include the -w flag for working directory

Open
#9,871 0 comments 0 reactions 0 assignees View on GitHub
enhancement provider/docker task-small
Dominant language
Ruby
Stars
27.2k
Forks
4.4k
Avg merge
1m
Merged PRs (30d)
1

Description

Vagrant 2.1.1
Windows 10
Docker 18.03.1-ce-win65 (17513)

I've setup a vagrantfile with a custom Ubuntu 16.04 image. It sets up nicely, but `vagrant docker-exec` is not executing in the `/vagrant` directory by default. I double checked the code, and sure enough, no `-w` flag is included in the call to `docker exec`. What's more, the command line wrapper rejects the `-w` flag and prints the help text. The default behavior should be to set the `-w` flag to point to `/vagrant` and to allow me to override that on the command line if I want. It could even be configurable in the `Vagrantfile`, but just the flag is enough to start. The code changes will take all of 2 minutes and will enhance the functionality of the docker plugin tremendously by making it MUCH more convenient.

Contributor guide

Open the contributing guide

Research direction

Start by locating the vagrant docker-exec command wrapper and the Docker exec invocation it uses. Check how command-line options are parsed, then verify that the working-directory option defaults to /vagrant and can be overridden; add or run the relevant command tests if present.

Written by the indexing model from the issue text.

Assessment

Tech stack
docker, ruby
Domain
cli, devops
Issue type
Feature
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.