-
Notifications
You must be signed in to change notification settings - Fork 521
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
tasks.json: dockerRun volumes: support bind? #2271
Comments
Related to #2259 I think. Probably the best approach for both is to add a catch-all "bring your own parameters" field to the |
That would be great! Or, alternatively if i could somehow have the docker run thing actually use my docker compose setup? I dunno if that's possible however. |
Depending on what you're doing it's possible that you don't need to use the We tried to design our debugging experience so that the |
I'm exploring the docker debugging in vscode. Can the docker debug use docker compose via shell? |
Most likely yes. Which platform are you debugging? (.NET Core, Node, Python) |
Python. A flask app to be specific. |
Gotcha. Your best bet is to make use of the Python attach configuration. Here's a setup that works for me, although it was behaving a little weirdly, it seemed to compose-up then do nothing, then I F5'd again, it'd try compose-up again and say it's up to date, then actually attach. The entrypoint in Dockerfile: # For more information, please refer to https://aka.ms/vscode-docker-python
FROM python:3.8-slim-buster
EXPOSE 5000
# Keeps Python from generating .pyc files in the container
ENV PYTHONDONTWRITEBYTECODE 1
# Turns off buffering for easier container logging
ENV PYTHONUNBUFFERED 1
# Install pip requirements
ADD requirements.txt .
RUN python -m pip install -r requirements.txt
WORKDIR /app
ADD . /app
# Switching to a non-root user, please refer to https://aka.ms/vscode-docker-python-user-rights
RUN useradd appuser && chown -R appuser /app
USER appuser
# During debugging, this entry point will be overridden. For more information, please refer to https://aka.ms/vscode-docker-python-debug
CMD ["gunicorn", "--bind", "0.0.0.0:5000", "app:app"] docker-compose.yml:
docker-compose.debug.yml:
tasks.json:
launch.json:
|
This is now fixed in Docker extension version 1.7.0. |
I often find it handy to 'bind' a volume to the host for development purposes. It helps me iterate quickly on things like Flask while in dev mode.
I can't seem to make that happen with the current syntax: it only makes a 'volume' mount. Would it be possible (or is it already somehow?) to expose the 'type' variable so I can bind volumes?
The text was updated successfully, but these errors were encountered: