Hi there,
I wanted to extend an existing prebuilt Amazon CodeBuild image and I was expecting to do so with a simple Dockerfile eg FROM aws/codebuild/docker:18.09.0.
Turns out these images aren't published anywhere, so I've had to mess about with a build for these images, pushing into ECR, so that I can extend them. Why aren't they available as images to extend?
Google Cloud provides pre-built images https://github.com/GoogleCloudPlatform/cloud-builders
I see related #11 but it's closed and doesn't make this usecase explicit, so I'm raising this separately.
Thanks,
Paul
They have plans once they have Codebuild Images on ECS AL2 or something!
Ha, didn't see that one. No clue what "AL2" means, so I'll leave it open to find out!
AL2 = Amazon Linux 2
would like to see this feature too
This feature would also be valuable for us as well.
With some third party packages signature verification being removed due to transient errors (per #231) I'd prefer if the image was published to the docker hub so that I may use the one built with package signature verification.
Looks like they just published an amazon linux 2 build: https://github.com/aws/aws-codebuild-docker-images/tree/master/al2/x86_64/standard/1.0
Amazon Linux 2 | aws/codebuild/amazonlinux2-x86_64-standard:1.0 | al2/standard/1.0
I built aws/codebuild/standard:2.0 from a fork of the git repository, you can see the details here:
https://hub.docker.com/r/jordanst3wart/aws-codebuild-docker-images
I'll try to keep the fork up to date.
You can run the image like:
docker run -it --rm jordanst3wart/aws-codebuild-docker-images sh
The image size is 3.43 GB still :| but it beats the 1 hour and 20 minute build time
Hi Paul,
Maybe:
FROM jordanst3wart/aws-codebuild-docker-images:latest
I don’t know if I have a “2.0” tag.
Jordan
On 15 December 2019 at 06:35:59, Paul Cruse ([email protected]notifications@github.com) wrote:
@jordanst3warthttps://github.com/jordanst3wart Thanks for putting up the image, I was thinking about doing it myself... but I was wondering how do I extend the Ubuntu standard 2.0 image? (I'm still kinda new to docker).
Do I just use:
FROM jordanst3wart/aws-codebuild-docker-images/aws/codebuild/standard:2.0
or am I far off?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHubhttps://github.com/aws/aws-codebuild-docker-images/issues/152?email_source=notifications&email_token=AC4VFXHETPSXNI2W33I2XBLQYUYRLA5CNFSM4GKGFGUKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEG4JSIQ#issuecomment-565745954, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AC4VFXBGHXWY6RKFOYRDHUDQYUYRLANCNFSM4GKGFGUA.
I would love to see this feature. Is there any movement on this?
Would also love to see this. I think it requires official movement from Amazon though
I really need this feature!
@subinataws : would y'all have any objection to us setting these up in our own docker hub accounts as public containers?
@2ps - Few customers already do this today. You may want to trim down the Docker image to only the runtime that you may be interested in, otherwise you could see long provisioning delay with the image not being pre-cached on the CodeBuild instance.
I think the key point here is that we would like the cached ones available to use in the base of a dockerfile, such that a small additional layer is the only download required during provisioning
I would also like to see the CodeBuild curated environment images published somewhere. I don't mind if it's Docker Hub, ECR, etc. Just anywhere would be great.
In the meantime, I have published some of the curated environment images as glassechidna/codebuild:ubuntu-4.0-20.05.05, etc. While these are completely unofficial and I have no affiliation with AWS, they are the same layers that are cached on the CodeBuild instances. I've not noticed any overhead when using them. Hope it can help someone else.
I would also like to see the CodeBuild curated environment images published somewhere. I don't mind if it's Docker Hub, ECR, etc. Just anywhere would be great.
In the meantime, I have published some of the curated environment images as
glassechidna/codebuild:ubuntu-4.0-20.05.05, etc. While these are completely unofficial and I have no affiliation with AWS, they are the same layers that are cached on the CodeBuild instances. I've not noticed any overhead when using them. Hope it can help someone else.
@aidansteele
out of curiosity, how were you able to get the same layers? I've tried to check if they are exposing image layers by any mode, the docker.sock is a dockerd launched within the container, so couldn't get the layers.
when I try to build the images, because of apt etc,.. there are a few minor changes which are changing the layer md5, and so not able to utilize caching
@zsrinivas I've been meaning to document the process, I will try get around to it soon. The tl;dr is that when you run a build with privileged mode enabled, you can do mkdir /host && mount /dev/nvmen1p1 /host to see the contents of the host's EBS root volume. Then you will find the layers at /host/var/lib/docker.
I made ubuntu standard 4.0 build here: https://hub.docker.com/repository/docker/ashr1/aws-codebuild/general
Please use it on your responsibility. I hope it'll be produced officially soon :)
I've been using @aidansteele 's glassechidna/codebuild:ubuntu-4.0-20.05.05 successfully for a while, but I now noticed that the provisioning time is back to >300secs again. I assume the image is now outdated.
How can I get the new sets of layers? I'm new to spelunking the content of /var/lib/docker directly, and I figured somebody else might have already solved this problem and is willing to share that with us.
(And it's frustrating that AWS people just doesn't seem to get how valuable this one feature is, especially given how it's so trivial for them to solve this...)
I'd love it if there was a public tarball in S3 or in a public ECR repository.
S3 could even be a "requester pays" bucket.
Once downloaded, anyone could run docker image load -i <file.tgz> to turn the tarball into a local docker image.
I did subsequently followed @aidansteele's message and looked into /var/lib/docker. The device name is now /dev/nvme0n1p1 for anyone who wants to do this. The entire /var/lib/docker is much too small to be possibly storing all the layers. So I'm not sure how to proceed.
I've also tried to run dockerd on top of the mounted /host/var/lib/docker, and that resulted in the following message. Ultimately, it appears that dockerd failed to start.
[Container] 2021/03/01 17:35:52 Running command nohup /usr/local/bin/dockerd --data-root=/host/var/lib/docker --host=unix:///var/run/docker.sock --host=tcp://0.0.0.0:2375 --storage-driver=overlay&
[Container] 2021/03/01 17:35:52 Running command timeout 15 sh -c "until docker info; do echo .; sleep 1; done"
time="2021-03-01T17:35:52.549816687Z" level=info msg="Starting up"
time="2021-03-01T17:35:52.553217456Z" level=warning msg="could not change group /var/run/docker.sock to docker: group docker not found"
time="2021-03-01T17:35:52.553359509Z" level=warning msg="[!] DON'T BIND ON ANY IP ADDRESS WITHOUT setting --tlsverify IF YOU DON'T KNOW WHAT YOU'RE DOING [!]"
time="2021-03-01T17:35:52.555004613Z" level=info msg="libcontainerd: started new containerd process" pid=211
time="2021-03-01T17:35:52.555056965Z" level=info msg="parsed scheme: \"unix\"" module=grpc
time="2021-03-01T17:35:52.555067871Z" level=info msg="scheme \"unix\" not registered, fallback to default scheme" module=grpc
time="2021-03-01T17:35:52.555094741Z" level=info msg="ccResolverWrapper: sending update to cc: {[{unix:///var/run/docker/containerd/containerd.sock 0 <nil>}] <nil>}" module=grpc
time="2021-03-01T17:35:52.555107742Z" level=info msg="ClientConn switching balancer to \"pick_first\"" module=grpc
time="2021-03-01T17:35:52.573014499Z" level=info msg="starting containerd" revision=8fba4e9a7d01810a393d5d25a3621dc101981175 version=v1.3.7
time="2021-03-01T17:35:52.592463989Z" level=info msg="loading plugin \"io.containerd.content.v1.content\"..." type=io.containerd.content.v1
time="2021-03-01T17:35:52.592529181Z" level=info msg="loading plugin \"io.containerd.snapshotter.v1.btrfs\"..." type=io.containerd.snapshotter.v1
time="2021-03-01T17:35:52.592716918Z" level=info msg="skip loading plugin \"io.containerd.snapshotter.v1.btrfs\"..." error="path /host/var/lib/docker/containerd/daemon/io.containerd.snapshotter.v1.btrfs (ext4) must be a btrfs filesystem to be used with the btrfs snapshotter: skip plugin" type=io.containerd.snapshotter.v1
time="2021-03-01T17:35:52.592749656Z" level=info msg="loading plugin \"io.containerd.snapshotter.v1.devmapper\"..." type=io.containerd.snapshotter.v1
time="2021-03-01T17:35:52.592766271Z" level=warning msg="failed to load plugin io.containerd.snapshotter.v1.devmapper" error="devmapper not configured"
time="2021-03-01T17:35:52.592775615Z" level=info msg="loading plugin \"io.containerd.snapshotter.v1.aufs\"..." type=io.containerd.snapshotter.v1
time="2021-03-01T17:35:52.592868600Z" level=info msg="skip loading plugin \"io.containerd.snapshotter.v1.aufs\"..." error="modprobe aufs failed: \"\": exec: \"modprobe\": executable file not found in $PATH: skip plugin" type=io.containerd.snapshotter.v1
time="2021-03-01T17:35:52.592879568Z" level=info msg="loading plugin \"io.containerd.snapshotter.v1.native\"..." type=io.containerd.snapshotter.v1
time="2021-03-01T17:35:52.592899425Z" level=info msg="loading plugin \"io.containerd.snapshotter.v1.overlayfs\"..." type=io.containerd.snapshotter.v1
time="2021-03-01T17:35:52.592955597Z" level=info msg="loading plugin \"io.containerd.snapshotter.v1.zfs\"..." type=io.containerd.snapshotter.v1
time="2021-03-01T17:35:52.593089231Z" level=info msg="skip loading plugin \"io.containerd.snapshotter.v1.zfs\"..." error="path /host/var/lib/docker/containerd/daemon/io.containerd.snapshotter.v1.zfs must be a zfs filesystem to be used with the zfs snapshotter: skip plugin" type=io.containerd.snapshotter.v1
time="2021-03-01T17:35:52.593102096Z" level=info msg="loading plugin \"io.containerd.metadata.v1.bolt\"..." type=io.containerd.metadata.v1
time="2021-03-01T17:35:52.593113287Z" level=warning msg="could not use snapshotter devmapper in metadata plugin" error="devmapper not configured"
time="2021-03-01T17:35:52.593121075Z" level=info msg="metadata content store policy set" policy=shared
[Container] 2021/03/01 17:36:07 Command did not exit successfully timeout 15 sh -c "until docker info; do echo .; sleep 1; done" exit status 124
[Container] 2021/03/01 17:36:07 Phase complete: BUILD State: FAILED
[Container] 2021/03/01 17:36:07 Phase context status code: COMMAND_EXECUTION_ERROR Message: Error while executing command: timeout 15 sh -c "until docker info; do echo .; sleep 1; done". Reason: exit status 124
failed to start containerd: timeout waiting for containerd to start
Let this guy know you're interested in this feature! https://twitter.com/nickcoult/status/1377656269155131392?s=19
Most helpful comment
This feature would also be valuable for us as well.