slimtoolkit / slim

Slim(toolkit): Don't change anything in your container image and minify it by up to 30x (and for compiled languages even more) making it secure too! (free and open source)
Apache License 2.0
19.21k stars 716 forks source link

docker-slim no longer works in gitlab-ci- wait timeout #428

Closed antyung88 closed 1 year ago

antyung88 commented 1 year ago

Expected Behavior

curl dockerslim release and execute in gitlab-ci -- using gitlab.com shared runners


Actual Behavior

wait timeout

cmd=build info=container message='obtained IP address' ip='172.18.0.2' 
time="2022-11-11T02:25:26Z" level=error msg="channel.NewCommandClient: NewClient error = wait timeout"
time="2022-11-11T02:25:26Z" level=error msg="ipc.NewClient init error = wait timeout"
cmd=build info=report file='slim.report.json' 
time="2022-11-11T02:25:26Z" level=fatal msg="docker-slim: failure" error="wait timeout" stack="goroutine 1 [running]:\nruntime/debug.Stack()\n\truntime/debug/stack.go:24 +0x65\ngithub.com/docker-slim/docker-slim/pkg/util/errutil.FailOn({0x1e8eda0, 0xc00041cbf0})\n\tgithub.com/docker-slim/docker-slim/pkg/util/errutil/errutil.go:28 +0x5e\ngithub.com/docker-slim/docker-slim/pkg/app.(*ExecutionContext).FailOn(0xc0004bc2c0?, {0x1e8eda0?, 0xc00041cbf0?})\n\tgithub.com/docker-slim/docker-slim/pkg/app/execontext.go:56 +0x49\ngithub.com/docker-slim/docker-slim/pkg/app/master/commands/build.OnCommand(_, _, {_, _}, _, {_, _}, {_, _}, {0x0, ...}, ...)\n\tgithub.com/docker-slim/docker-slim/pkg/app/master/commands/build/handler.go:876 +0x41eb\ngithub.com/docker-slim/docker-slim/pkg/app/master/commands/build.glob..func1(0xc0005d9840)\n\tgithub.com/docker-slim/docker-slim/pkg/app/master/commands/build/cli.go:607 +0x4730\ngithub.com/urfave/cli/v2.(*Command).Run(0x2c63880, 0xc0005754c0)\n\tgithub.com/urfave/cli/v2@v2.3.0/command.go:163 +0x5dc\ngithub.com/urfave/cli/v2.(*App).RunContext(0xc0003cd6c0, {0x1ea8170?, 0xc000050078}, {0xc00003e0b0, 0xb, 0xb})\n\tgithub.com/urfave/cli/v2@v2.3.0/app.go:313 +0xb7d\ngithub.com/urfave/cli/v2.(*App).Run(...)\n\tgithub.com/urfave/cli/v2@v2.3.0/app.go:224\ngithub.com/docker-slim/docker-slim/pkg/app/master.Run()\n\tgithub.com/docker-slim/docker-slim/pkg/app/master/app.go:15 +0x46\nmain.main()\n\tgithub.com/docker-slim/docker-slim/cmd/docker-slim/main.go:15 +0x18e\n" version="linux|Transformer|1.39.0|f502574b8d8818e86e90d902708d0e32d1acf8f7|2022-10-25_05:05:23AM"

Steps to Reproduce the Problem

.gitlab-ci.yml ``` .vars_docker: variables: tag: latest .docker-build: stage: docker-build variables: ! reference [.vars_docker, variables] script: # any image - docker build . -t $CI_REGISTRY_IMAGE:$tag # slim-build - apk add --no-cache curl util-linux tar - curl -L -O https://downloads.dockerslim.com/releases/1.39.0/dist_linux.tar.gz - tar -zxvf dist_linux.tar.gz - script -q -c "./dist_linux/docker-slim --debug version" - script -q -c "./dist_linux/docker-slim build --target $CI_REGISTRY_IMAGE:$tag --http-probe=false --include-path /bin --include-path /usr/bin --tag $CI_REGISTRY_IMAGE:slim" docker-build: extends: .docker-build when: manual needs: [] stages: - docker-build ``` --- Specifications ================= - Version: 1.39.0 - Platform: gitlab.com
antyung88 commented 1 year ago

fixed by: https://github.com/docker-slim/docker-slim/issues/129

updated script:

    - script -q -c "./dist_linux/docker-slim build --sensor-ipc-mode proxy --target $CI_REGISTRY_IMAGE:$tag --http-probe=false --include-path /bin --include-path /usr/bin --tag $CI_REGISTRY_IMAGE:slim trademark;"