slimtoolkit / slimtoolkit/slim

[docker-slim build] clears everything needed for a node.js app to run

Open
#138 1 comment 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

triage
Dominant language
Go
Stars
23.4k
Forks
840
PR merge metrics
No merged PRs in 30d

Description

[docker-slim build] clears node binary, also leaves an empty app folder.
I use it like this:

docker-slim build --http-probe=false --continue-after=1 <image>

And the log:

➜  ~ docker-slim build --http-probe=false --continue-after=1 fake.registry.com/project-ns/k8s-demo-grpc:200318113604
docker-slim[build]: state=started
docker-slim[build]: info=params target=fake.registry.com/project-ns/k8s-demo-grpc:200318113604 continue.mode=timeout rt.as.user=true keep.perms=true
docker-slim[build]: state=image.inspection.start
docker-slim[build]: info=image id=sha256:8b6db1eb8a6bdf1fe73b2c5cf2a6af27dbc53b59f0c8f2f56b07c3efa39c0036 size.bytes=405464967 size.human=406 MB
Q TMP: CMD exec form...
Q TMP: ENTRYPOINT exec form...
Q TMP: ENTRYPOINT shell form...
docker-slim[build]: info=image.stack index=0 name='fake.registry.com/integration-ns/bare-node:v0.0.10' id='sha256:b913e69307f8c6fa2415df797ee9342bd729a458c7f4f77ea53dcdf13b3ced8c'
docker-slim[build]: info=image.stack index=1 name='fake.registry.com/project-ns/k8s-demo-grpc:200318113604' id='sha256:8b6db1eb8a6bdf1fe73b2c5cf2a6af27dbc53b59f0c8f2f56b07c3efa39c0036'
docker-slim[build]: state=image.inspection.done
docker-slim[build]: state=container.inspection.start
docker-slim[build]: info=container status=created name=dockerslimk_11153_20200318043124 id=361aa54baf45d105c06f49c12d6fb5e5607acb139dcbd976bcb0681c90b0cb5b
docker-slim[build]: info=cmd.startmonitor status=sent
docker-slim[build]: info=event.startmonitor.done status=received
docker-slim[build]: info=container name=dockerslimk_11153_20200318043124 id=361aa54baf45d105c06f49c12d6fb5e5607acb139dcbd976bcb0681c90b0cb5b target.port.list=[] target.port.info=[] message='YOU CAN USE THESE PORTS TO INTERACT WITH THE CONTAINER'
docker-slim[build]: info=continue.after mode=timeout message='no input required, execution will resume after the timeout'
docker-slim[build]: info=prompt message='waiting for the target container (1 seconds)'
docker-slim[build]: info=event message='done waiting for the target container'
docker-slim[build]: state=container.inspection.finishing
docker-slim[build]: state=container.inspection.artifact.processing
docker-slim[build]: state=container.inspection.done
docker-slim[build]: state=building message='building optimized image'
docker-slim[build]: state=completed
docker-slim[build]: info=results status='MINIFIED BY 90.83X [405464967 (406 MB) => 4464078 (4.5 MB)]'
docker-slim[build]: info=results  image.name=fake.registry.com/project-ns/k8s-demo-grpc.slim image.size='4.5 MB' data=true
docker-slim[build]: info=results  artifacts.location='/tmp/docker-slim-state/.docker-slim-state/images/8b6db1eb8a6bdf1fe73b2c5cf2a6af27dbc53b59f0c8f2f56b07c3efa39c0036/artifacts'
docker-slim[build]: info=results  artifacts.report=creport.json
docker-slim[build]: info=results  artifacts.dockerfile.original=Dockerfile.fat
docker-slim[build]: info=results  artifacts.dockerfile.new=Dockerfile
docker-slim[build]: info=results  artifacts.seccomp=fake.registry.com-project-ns-k8s-demo-grpc-seccomp.json
docker-slim[build]: info=results  artifacts.apparmor=fake.registry.com-project-ns-k8s-demo-grpc-apparmor-profile
docker-slim[build]: state=done

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the issue with the documented docker-slim build command and the supplied image/log output. Inspect the generated slim image to determine why the Node.js binary and app directory are removed; done means the optimized image retains the files needed for the Node.js app to run.

Written by the indexing model from the issue text.

Assessment

Tech stack
docker, go, node.js
Domain
devops, infrastructure
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.