Skip to content

Extremely slow run using Docker #4991

Answered by ldez
bentcoder asked this question in Q&A
Sep 8, 2024 · 2 comments · 32 replies
Discussion options

You must be logged in to vote

This element --volume ${PWD}/tmp/golangci:/root/.cache:rw implies this:

${PWD}
├── go.mod
├── go.sum
├── main.go
├── ...
└── tmp <------------
    └── golangci
        └── ...

And because --volume ${PWD}:/source:ro, the ${PWD}/tmp/golangci folder is also 2 times inside the container:

/
├── root
│   └── .cache <----------
│       └── ...
├── source
│  ├── go.mod
│  ├── go.sum
│  ├── main.go
│  ├── ...
│  └── tmp <----------
│      └── golangci
│          └── ...
└── ...

So tmp folder is inside the project, like the other project files.

You should remove this folder and using something like that:

docker run \
	--rm \
	--tty \
	--workdir /source \
	--volume ${PWD}:/source:ro \
	--volume /t…

Replies: 2 comments 32 replies

Comment options

You must be logged in to vote
4 replies
@bentcoder
Comment options

@ldez
Comment options

Answer selected by bentcoder
@bentcoder
Comment options

@ldez
Comment options

Comment options

You must be logged in to vote
28 replies
@bentcoder
Comment options

@ldez
Comment options

@ldez
Comment options

@ldez
Comment options

@bentcoder
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants