slimtoolkit / slimtoolkit/slim

Failure with ARM container running in AWS CodeBuild

Open
#109 5 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

This same setup works fine on my MacBook Pro - same Dockerfile and build, same docker-slim invocation. I'm trying to get the same setup to work in CodeBuild. It may be worth mentioning - could be related - that the image I'm building is for armhf but I'm running on x86_64 on the host.

Here's the output when I run in CodeBuild:

[Container] 2019/12/12 06:34:34 Running command /tmp/docker-slim build --http-probe=false --continue-after 20 mosquitto 
docker-slim[build]: state=started 
docker-slim[build]: info=params target=mosquitto continue.mode=timeout 
docker-slim[build]: state=image.inspection.start 
docker-slim[build]: info=image id=sha256:91b3503e148d20dc7fb30893771a0d653498f4d3efc53d066447c22a38207ecc size.bytes=178925852 size.human=179 MB 
docker-slim[build]: info=image.stack index=0 name='balenalib/armv7hf-alpine:3.9-run' id='sha256:ab2e215257f0e5ad3a590e54ab721b7e4b6195b52dad28a21fb5ad65450145c7' 
docker-slim[build]: info=image.stack index=1 name='mosquitto:latest' id='sha256:91b3503e148d20dc7fb30893771a0d653498f4d3efc53d066447c22a38207ecc' 
docker-slim[build]: info=image.exposed_ports list='1883,8883' 
docker-slim[build]: state=image.inspection.done 
docker-slim[build]: state=container.inspection.start 
docker-slim[build]: info=container status=created name=dockerslimk_2107_20191212063435 id=49e3da49e38b0de1212657b2d33a5b3dd5e03114236f4b7917a0013e3d4d29a1 
docker-slim[build]: info=cmd.startmonitor status=sent 
docker-slim[build]: info=event.error status=received data=SensorError{Op:sensor.ptrace.Run/target.Start,Kind:call.error,Wrapped:{Type=*os.PathError,Info=fork/exec /usr/bin/entry.sh: exec format error,Line:88,File:github.com/docker-slim/docker-slim@/internal/app/sensor/monitors/ptrace/monitor.go}} 
docker-slim[build]: state=exited version=linux|Transformer|1.26.1|2ec04e169b12a87c5286aa09ef44eac1cea2c7a1|2019-11-28_04:37:59PM 
 
[Container] 2019/12/12 06:34:35 Command did not exit successfully /tmp/docker-slim build --http-probe=false --continue-after 20 mosquitto exit status 132 
[Container] 2019/12/12 06:34:35 Phase complete: BUILD State: FAILED 
[Container] 2019/12/12 06:34:35 Phase context status code: COMMAND_EXECUTION_ERROR Message: Error while executing command: /tmp/docker-slim build --http-probe=false --continue-after 20 mosquitto. Reason: exit status 132 

I assume this is the relevant part:

{Type=*os.PathError,Info=fork/exec /usr/bin/entry.sh: exec format error,Line:88,File:github.com/docker-slim/docker-slim@/internal/app/sensor/monitors/ptrace/monitor.go}

On my MacBook I get this:

$ .../docker-slim build --http-probe=false --continue-after 20 mosquitto
docker-slim[build]: state=started
docker-slim[build]: info=params target=mosquitto continue.mode=timeout
docker-slim[build]: state=image.inspection.start
docker-slim[build]: info=image id=sha256:6c325f64bc1714ff4317ea1e67e6abf39631b6ace1acf35917ec608a07194b28 size.bytes=175693956 size.human=176 MB
docker-slim[build]: info=image.stack index=0 name='balenalib/armv7hf-alpine:3.9-run' id='sha256:ab2e215257f0e5ad3a590e54ab721b7e4b6195b52dad28a21fb5ad65450145c7'
docker-slim[build]: info=image.stack index=1 name='mosquitto:latest' id='sha256:6c325f64bc1714ff4317ea1e67e6abf39631b6ace1acf35917ec608a07194b28'
docker-slim[build]: info=image.exposed_ports list='1883,8883'
docker-slim[build]: state=image.inspection.done
docker-slim[build]: state=container.inspection.start
docker-slim[build]: info=container status=created name=dockerslimk_74755_20191212215300 id=446d664664d0a424fb7f8fef507771448feed30226eb4a93b09c80fc74c037b6
docker-slim[build]: info=cmd.startmonitor status=sent
docker-slim[build]: info=event.startmonitor.done status=received
docker-slim[build]: info=container name=dockerslimk_74755_20191212215300 id=446d664664d0a424fb7f8fef507771448feed30226eb4a93b09c80fc74c037b6 target.port.list=[32771,32770] target.port.info=[1883/tcp => 0.0.0.0:32771,8883/tcp => 0.0.0.0:32770] 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 (20 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 minified image'
docker-slim[build]: state=completed
docker-slim[build]: info=results status='MINIFIED BY 37.37X [175693956 (176 MB) => 4701356 (4.7 MB)]'
docker-slim[build]: info=results  image.name=mosquitto.slim image.size='4.7 MB' data=true
docker-slim[build]: info=results  artifacts.location='/Users/mark/Downloads/dist_mac/.docker-slim-state/images/6c325f64bc1714ff4317ea1e67e6abf39631b6ace1acf35917ec608a07194b28/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=mosquitto-seccomp.json
docker-slim[build]: info=results  artifacts.apparmor=mosquitto-apparmor-profile
docker-slim[build]: state=done
docker-slim[build]: info=report file='slim.report.json'

I'm going to keep hacking away at it for now but any suggestions would be very welcome.

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 by comparing the CodeBuild and MacBook invocations and the differing container-inspection logs. Read internal/app/sensor/monitors/ptrace/monitor.go around line 88, then reproduce the armhf image on the x86_64 CodeBuild host. Done should include a confirmed diagnosis and a documented or validated path for this setup.

Written by the indexing model from the issue text.

Assessment

Tech stack
aws, docker, go
Domain
cloud, devops
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 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.