EuRBamarth
EuRBamarth

Reputation: 974

No output when running `flake8 src` in Docker container

I have built an image myimage with Docker using the following Dockerfile:

FROM python:3.7

RUN pip install flake8

and then running

docker build -t myimage .

.

Now, if I run flake8 src in the terminal (in a conda environment where I have flake8 installed), then I get a few warnings. But if I run

docker run myimage flake8 src

then I get no output!

What is the correct way to run flake8 within a docker container so that I can see the output?

Upvotes: 2

Views: 2175

Answers (2)

EuRBamarth
EuRBamarth

Reputation: 974

Turns out I needed to use the -v flag to mount the local volume.

docker run -v $(pwd)/src:/src myimage flake8 src

This works as expected

Upvotes: 0

LinPy
LinPy

Reputation: 18578

flake8 src has no output try this instead flake8 -vvv src

Upvotes: 4

Related Questions