slimtoolkit / slimtoolkit/slim
Show logs eagerly instead of lazily
Nobody has claimed this yet.
- Dominant language
- Go
- Stars
- 23.4k
- Forks
- 841
- PR merge metrics
- No merged PRs in 30d
Description
I'm trying to build a Dockerfile I normally run with docker-compose, so there's lots of arguments that I keep forgetting to add (--mount, --env, etc.). It's painful to troubleshoot this because I have to wait for docker-slim to make five tries and timeout before I can see what the error is. Would it be possible to show the logs from --show-clogs immediately, after the first HTTP failure?
Current output:
docker-slim[build]: info=container name=dockerslimk_17520_20191212010301 id=e6285282f34f2ed3a00152b847a3078719fa04173448724d842d18769fe8df7c target.port.list=[32794] target.port.info=[3000/tcp => 0.0.0.0:32794] message='YOU CAN USE THESE PORTS TO INTERACT WITH THE CONTAINER'
docker-slim[build]: state=http.probe.starting message='WAIT FOR HTTP PROBE TO FINISH'
docker-slim[build]: info=continue.after mode=probe message='no input required, execution will resume when HTTP probing is completed'
docker-slim[build]: info=prompt message='waiting for the HTTP probe to finish'
docker-slim[build]: state=http.probe.running
docker-slim[build]: info=http.probe.ports count=1 targets='32794'
docker-slim[build]: info=http.probe.commands count=1 commands='GET /'
docker-slim[build]: info=http.probe.call status=error method=GET target=http://127.0.0.1:32794/ attempt=1 error='Get http://127.0.0.1:32794/: read tcp 127.0.0.1:56516->127.0.0.1:32794: read: connection reset by peer' time=2019-12-12T01:03:14Z
docker-slim[build]: info=http.probe.call status=error method=GET target=http://127.0.0.1:32794/ attempt=2 error='Get http://127.0.0.1:32794/: read tcp 127.0.0.1:56524->127.0.0.1:32794: read: connection reset by peer' time=2019-12-12T01:03:22Z
docker-slim[build]: info=http.probe.call status=error method=GET target=http://127.0.0.1:32794/ attempt=3 error='Get http://127.0.0.1:32794/: read tcp 127.0.0.1:56546->127.0.0.1:32794: read: connection reset by peer' time=2019-12-12T01:03:30Z
docker-slim[build]: info=http.probe.call status=error method=GET target=http://127.0.0.1:32794/ attempt=4 error='Get http://127.0.0.1:32794/: read tcp 127.0.0.1:56552->127.0.0.1:32794: read: connection reset by peer' time=2019-12-12T01:03:38Z
docker-slim[build]: info=http.probe.call status=error method=GET target=http://127.0.0.1:32794/ attempt=5 error='Get http://127.0.0.1:32794/: read tcp 127.0.0.1:56556->127.0.0.1:32794: read: connection reset by peer' time=2019-12-12T01:03:46Z
docker-slim[build]: info=http.probe.summary total=5 failures=5 successful=0
docker-slim[build]: state=http.probe.done warning=no.successful.calls
docker-slim[build]: info=event message='HTTP probe is done'
docker-slim[build]: state=container.inspection.finishing
docker-slim: container stdout:
docker-slim: container stderr:
time="2019-12-12T01:03:02Z" level=info msg="sensor: args => []string{\"/opt/dockerslim/bin/docker-slim-sensor\"}"
time="2019-12-12T01:03:02Z" level=info msg="sensor: waiting for commands..."
time="2019-12-12T01:03:02Z" level=info msg="sensor: monitor starting..."
time="2019-12-12T01:03:02Z" level=info msg="fanmon: Run"
time="2019-12-12T01:03:02Z" level=info msg="ptmon: Run"
... the output from my container ...
Requested output:
docker-slim[build]: info=container name=dockerslimk_17520_20191212010301 id=e6285282f34f2ed3a00152b847a3078719fa04173448724d842d18769fe8df7c target.port.list=[32794] target.port.info=[3000/tcp => 0.0.0.0:32794] message='YOU CAN USE THESE PORTS TO INTERACT WITH THE CONTAINER'
docker-slim[build]: state=http.probe.starting message='WAIT FOR HTTP PROBE TO FINISH'
docker-slim[build]: info=continue.after mode=probe message='no input required, execution will resume when HTTP probing is completed'
docker-slim[build]: info=prompt message='waiting for the HTTP probe to finish'
docker-slim[build]: state=http.probe.running
docker-slim[build]: info=http.probe.ports count=1 targets='32794'
docker-slim[build]: info=http.probe.commands count=1 commands='GET /'
docker-slim[build]: info=http.probe.call status=error method=GET target=http://127.0.0.1:32794/ attempt=1 error='Get http://127.0.0.1:32794/: read tcp 127.0.0.1:56516->127.0.0.1:32794: read: connection reset by peer' time=2019-12-12T01:03:14Z
docker-slim: container stdout:
docker-slim: container stderr:
time="2019-12-12T01:03:02Z" level=info msg="sensor: args => []string{\"/opt/dockerslim/bin/docker-slim-sensor\"}"
time="2019-12-12T01:03:02Z" level=info msg="sensor: waiting for commands..."
time="2019-12-12T01:03:02Z" level=info msg="sensor: monitor starting..."
time="2019-12-12T01:03:02Z" level=info msg="fanmon: Run"
time="2019-12-12T01:03:02Z" level=info msg="ptmon: Run"
... the output from my container ...
... all the other output I pasted above ...
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by tracing the --show-clogs handling and the HTTP probe retry path. Verify how container stdout and stderr are collected, then make the requested output appear after the first HTTP failure while preserving the remaining probe behavior; the shown requested output defines done.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- docker, go
- Domain
- cli, devops
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100