slimtoolkit / slimtoolkit/slim

API error (500): fill out specgen: must set source volume

Open
#340 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

Expected Behavior

Tried running a docker-slim build against an image I have locally.

docker-slim build <myimage>:<mytag>

I would expect it to build a slim image.


Actual Behavior

received:

cmd=build state=container.inspection.start
time="2022-06-08T10:17:46+01:00" level=debug msg="FatContainerCmd - [/bin/sh]" app=docker-slim command=build component=container.inspector
time="2022-06-08T10:17:46+01:00" level=info msg="starting instrumented 'fat' container..." app=docker-slim command=build
time="2022-06-08T10:17:46+01:00" level=debug msg="RunContainer: sensor (/usr/local/bin/docker-slim-sensor) perms => 0755" app=docker-slim command=build component=container.inspector
time="2022-06-08T10:17:46+01:00" level=debug msg="ensureSensorVolume: already have volume = docker-slim-sensor.1.37.6" app=docker-slim command=build component=container.inspector
time="2022-06-08T10:17:46+01:00" level=debug msg="RunContainer: default exposed ports => map[docker.Port]struct {}{\"65501/tcp\":struct {}{}, \"65502/tcp\":struct {}{}}" app=docker-slim command=build component=container.inspector
time="2022-06-08T10:17:46+01:00" level=debug msg="RunContainer: HostConfig.PublishAllPorts => true" app=docker-slim command=build component=container.inspector
cmd=build info=report file='slim.report.json'
time="2022-06-08T10:17:46+01:00" level=fatal msg="docker-slim: failure" error="API error (500): fill out specgen: must set source volume" stack="goroutine 1 [running]:\nruntime/debug.Stack(0xc000410800, 0xf668f8, 0xc0003b25d0)\n\truntime/debug/stack.go:24 +0x9f\ngithub.com/docker-slim/docker-slim/pkg/util/errutil.FailOn(0x10cce20, 0xc0004447c0)\n\tgithub.com/docker-slim/docker-slim/pkg/util/errutil/errutil.go:28 +0x54\ngithub.com/docker-slim/docker-slim/pkg/app.(*ExecutionContext).FailOn(0xc00071a780, 0x10cce20, 0xc0004447c0)\n\tgithub.com/docker-slim/docker-slim/pkg/app/execontext.go:49 +0x3a\ngithub.com/docker-slim/docker-slim/pkg/app/master/commands/build.OnCommand(0xc00071a780, 0xc0000b0200, 0x7ffc85a3a6b8, 0x22, 0x0, 0x0, 0x174ab78, 0x0, 0x0, 0x0, ...)\n\tgithub.com/docker-slim/docker-slim/pkg/app/master/commands/build/handler.go:1061 +0x3175\ngithub.com/docker-slim/docker-slim/pkg/app/master/commands/build.glob..func1(0xc000808700, 0x86, 0x130)\n\tgithub.com/docker-slim/docker-slim/pkg/app/master/commands/build/cli.go:662 +0x3688\ngithub.com/urfave/cli/v2.(*Command).Run(0x16e0f00, 0xc0000ac580, 0x0, 0x0)\n\tgithub.com/urfave/cli/v2@v2.3.0/command.go:163 +0x4ed\ngithub.com/urfave/cli/v2.(*App).RunContext(0xc0000b8000, 0x10e42a0, 0xc000124010, 0xc00010c050, 0x5, 0x5, 0x0, 0x0)\n\tgithub.com/urfave/cli/v2@v2.3.0/app.go:313 +0x81f\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 +0x6c\nmain.main()\n\tgithub.com/docker-slim/docker-slim/cmd/docker-slim/main.go:15 +0x54\n" version="linux|Transformer|1.37.6|26a36c88a94c677efd734e874ba081dabb84a224|2022-04-23_06:03:56AM"

Steps to Reproduce the Problem

  1. Create Dockerfile:
FROM frolvlad/alpine-glibc:alpine-3.15_glibc-2.34

ARG TKN_VERSION=0.22.0
ARG OC_VERSION=4.7
ARG USER=octkn
ARG UID=1000
ARG GID=1000

ENV HOME="/home/octkn"

RUN addgroup -S -g ${GID} ${USER} && \
    adduser -S -D -u ${UID} -G ${USER} ${USER} && \
    wget -O- https://github.com/tektoncd/cli/releases/download/v${TKN_VERSION}/tkn_${TKN_VERSION}_Linux_x86_64.tar.gz | tar zxf - -C /usr/local/bin && \
    wget -O- https://mirror.openshift.com/pub/openshift-v4/x86_64/clients/ocp/stable-${OC_VERSION}/openshift-client-linux.tar.gz | tar zxf - -C /usr/local/bin && \
    apk update && apk add jq bash curl && \
    apk add --update ca-certificates && \
    rm -rf /var/cache/apk/* && \
    chown -R ${UID}:0 /home/octkn && \
    chmod -R g=u /home/octkn
	
USER ${UID}
  1. Build image (using docker/podman)
  2. Ensure image available locally
  3. Run docker-slim --log-level debug build <image>:<tag>
  4. Get results above

Specifications

  • Version: docker-slim version linux|Transformer|1.37.6|26a36c88a94c677efd734e874ba081dabb84a224|2022-04-23_06:03:56AM
  • Platform: uname -a - Linux IBM-PF312AMV 5.10.102.1-microsoft-standard-WSL2 #1 SMP Wed Mar 2 00:30:59 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux

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

Start at pkg/app/master/commands/build/handler.go:1061, where the stack trace reports the failure, and inspect the container inspection flow preceding the missing source volume error. Reproduce the build with the Dockerfile and local image described in the issue. Done means the build completes without the API 500 error.

Written by the indexing model from the issue text.

Assessment

Tech stack
docker, go
Domain
cli, devops
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.