You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have verified that both 3.3.0 and 3.3.1 fail with the same error when using aws-xray-daemon as a base image for the following docker file when running in AWS Codebuild (just show the file using the latest, but setting the version explicitly fails as well).
0.324 container_linux.go:349: starting container process caused "exec: \"/bin/sh\": stat /bin/sh: no such file or directory"
It does not fail in version 3.2.0. This error started showing up in our pipelines after your recent release.
Further, this error does not occur building the docker file on OSX 10.14.6, for reference.
This error actually has nothing to do with the presence of /tini file as I have also run this with a generic bash command before that statement ls -la in a test version of the docker file and got the same error message (partial log):
#12 [1/7] FROM docker.io/amazon/aws-xray-daemon@sha256:257520f15ad830044f73d...#12 resolve docker.io/amazon/aws-xray-daemon@sha256:257520f15ad830044f73d1b194bb857d61865a48b9d6b39e76e35491ea620e93 done#12 sha256:3e37efe593d7d3a497e2d864356cef53d2de46da16029efff0db87e8f253f18b 0B / 605B 0.1s#12 sha256:b74e1e16d401488307c5e5afa74d8dbfdfa74f320efb8eef1e3a582224e1736b 0B / 122.41kB 0.1s#12 sha256:257520f15ad830044f73d1b194bb857d61865a48b9d6b39e76e35491ea620e93 743B / 743B done#12 sha256:eb0fd00316c41f07e47a2f42edf6e79601b9116c948147084c82e17a4dafa3d6 1.15kB / 1.15kB done#12 sha256:f9066f994766b7bfaf916a45511091f6b1702904139d861bf4867d3e71fe2ec3 1.42kB / 1.42kB done#12 sha256:1454e538c265c921848ec6bf7b91f37b90ca3f5eca3afb125cadcfe976d3cbd5 0B / 3.39MB 0.1s#12 sha256:3e37efe593d7d3a497e2d864356cef53d2de46da16029efff0db87e8f253f18b 605B / 605B 0.1s done#12 sha256:1454e538c265c921848ec6bf7b91f37b90ca3f5eca3afb125cadcfe976d3cbd5 261.10kB / 3.39MB 0.2s#12 sha256:958577898abbd97dc9f7a556e3cb671c091246492bd9eaffd5d2675e4d14a869 0B / 807B 0.2s#12 extracting sha256:1454e538c265c921848ec6bf7b91f37b90ca3f5eca3afb125cadcfe976d3cbd5#12 sha256:b74e1e16d401488307c5e5afa74d8dbfdfa74f320efb8eef1e3a582224e1736b 122.41kB / 122.41kB 0.3s done#12 sha256:1454e538c265c921848ec6bf7b91f37b90ca3f5eca3afb125cadcfe976d3cbd5 3.39MB / 3.39MB 0.3s done#12 sha256:958577898abbd97dc9f7a556e3cb671c091246492bd9eaffd5d2675e4d14a869 807B / 807B 0.3s done#12 extracting sha256:1454e538c265c921848ec6bf7b91f37b90ca3f5eca3afb125cadcfe976d3cbd5 0.2s done#12 extracting sha256:3e37efe593d7d3a497e2d864356cef53d2de46da16029efff0db87e8f253f18b done#12 extracting sha256:b74e1e16d401488307c5e5afa74d8dbfdfa74f320efb8eef1e3a582224e1736b 0.0s done#12 extracting sha256:958577898abbd97dc9f7a556e3cb671c091246492bd9eaffd5d2675e4d14a869#12 extracting sha256:958577898abbd97dc9f7a556e3cb671c091246492bd9eaffd5d2675e4d14a869 done#12 DONE 0.9s#5 [2/7] RUN ls -la#5 0.324 container_linux.go:349: starting container process caused "exec: \"/bin/sh\": stat /bin/sh: no such file or directory"#5 ERROR: executor failed running [/bin/sh -c ls -la]: runc did not terminate sucessfully
------
> [2/7] RUN ls -la:
------
failed to solve with frontend dockerfile.v0: failed to build LLB: executor failed running [/bin/sh -c ls -la]: runc did not terminate sucessfully
[Container] 2021/04/14 11:59:02 Command did not exit successfully bash ./build.sh exit status 1
[Container] 2021/04/14 11:59:02 Phase complete: BUILD State: FAILED
[Container] 2021/04/14 11:59:02 Phase context status code: COMMAND_EXECUTION_ERROR Message: Error while executing command: bash ./build.sh. Reason: exit status 1
[Container] 2021/04/14 11:59:02 Entering phase POST_BUILD
[Container] 2021/04/14 11:59:02 Phase complete: POST_BUILD State: SUCCEEDED
[Container] 2021/04/14 11:59:02 Phase context status code: Message:
I am not sure what type of instance Codebuild is using to run this and happy to add that information if you tell me what you need and how to get it from AWS console.
The text was updated successfully, but these errors were encountered:
fosrias
changed the title
/bin/sh not available when building container in AWS Codebuild with aws-xray-daemon base image
/bin/sh not available when building image in AWS Codebuild with aws-xray-daemon base image
Apr 14, 2021
Thank you for raising this. In the latest releases of the daemon, we switched the base image of the amazon/aws-xray-daemon image from amazonlinux to scratch, as you can see in our Dockerfile. This greatly reduced the size of the daemon image from about 150 MB to about 3 MB. However this change also removes all of the executables that existed alongside the daemon binary in its image, such as /bin/sh which you were trying to use.
We didn't sufficiently consider that customers were using the tooling provided by amazonlinux, but we are now aware of that issue and are considering different approaches for structuring the image. We will post updates to this issue as we have them.
For now, I would suggest using a Docker multi-stage build for your Dockerfile. In the build stage, you can use a heavier linux base image to set up your /tini project. After that, you can add another stage with amazon/aws-xray-daemon as the parent image.
I have verified that both 3.3.0 and 3.3.1 fail with the same error when using
aws-xray-daemon
as a base image for the following docker file when running in AWS Codebuild (just show the file using the latest, but setting the version explicitly fails as well).0.324 container_linux.go:349: starting container process caused "exec: \"/bin/sh\": stat /bin/sh: no such file or directory"
It does not fail in version 3.2.0. This error started showing up in our pipelines after your recent release.
Further, this error does not occur building the docker file on OSX 10.14.6, for reference.
The error log is:
Error shows up at line 326.
This error actually has nothing to do with the presence of
/tini
file as I have also run this with a generic bash command before that statementls -la
in a test version of the docker file and got the same error message (partial log):I am not sure what type of instance Codebuild is using to run this and happy to add that information if you tell me what you need and how to get it from AWS console.
The text was updated successfully, but these errors were encountered: