Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Docker run from windows – cat not working

docker run -i --rm postgres cat /usr/share/postgresql/postgresql.conf.sample > my-postgres.conf

I expect a file to be created as my-postgres.conf on my host machine which is a copy of the file: /usr/share/postgresql/postgresql.conf.sample which comes from postgres.

Observed Output:

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

cat: 'C:/Program Files/Git/usr/share/postgresql/postgresql.conf.sample': No such file or directory

Is there any missing step?

>Solution :

With windows you can pass in the -c:

docker run -i --rm postgres sh -c 'cat /usr/share/postgresql/postgresql.conf.sample' > my-postgres.conf
Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading