How to develop on Windows with Docker

docker
windows

#1

I am stuck having to develop on Windows. :frowning: :cry:

What are some good reading materials on this? Existing content seems to believe that everyone is allowed to develop on Linux and that is not the case for this client.

Specifically, at the moment, I can’t figure out how to start an airflow container and get an interactive bash prompt.

winpty docker run -it airflow_container bash starts the container and printing the container but does not allow an interactive bash prompt.

winpty docker run -it airflow_container airflow list_dags and winpty docker run -it airflow_container airflow test DAG_NAME also do not work.


#2

I haven’t used airflow, but do you know the absolute path on the image’s filesystem for bash? That might come closer to getting you what you want.

You can have a look at the batch files in https://gitlab.com/ClayDowling/genesys-sheet/

The project is for a Linux rest server written in C, which I generally develop on my Windows tablet.


#3

I haven’t used winpty, but Docker comments work just about the same between Linux and the Windows Command Prompt / PowerShell. I’ve been able to run -it many containers without issues.

The only thing I’ve had to be careful of is bind-mounting absolute paths (C:\aaa\bbb) and not relative ones, but I’m not even sure if relative paths work on Linux/macOS.


#4

Thanks @ClayDowling and @yaakov. Previously I had changed the path to bash in the ENTRYPOINT command in the Dockerfile to get Windows to find it based on some google-fu. Then, based on what a colleague told me, it turns out the thing that solved it was commenting out the ENTRYPOINT line entirely. By commenting it out entirely the command to run the webserver process doesn’t start and you can have a normal bash prompt.


#5

I have helped with review of https://www.packtpub.com/virtualization-and-cloud/docker-aspnet-core-mvc-video
Some content is aspnet specific but it’s mostly about using docker on Windows