r/aws•
Deif

CodeBuild managed build images reduced to Ubuntu standard 2.0

technical resource

Came across this just now and was confused that the available runtimes had been reduced. 1

​ You now can specify your runtimes in the buildspec:

phases:
  install:
    runtime-versions:
      nodejs: 10

I guess the change helps AWS in provisioning.

Posted May 20, 2019, 10:43 AM UTC

123
Autom8Jeep•

AWS sent out an email to account owners last month about Ubuntu 14.04 images being depreciated, since 14.04 is EOL. It was also in the Personal Health Dashboard, which is good to check every once in awhile for system change announcements from AWS, such as the Lambda execution environment update starting this month.

1
aquaponicbrian•

i have been using codebuild and codepipeline to buuild docker images for about 2 years and all the sudden at some point in the last week any new builds do not work anymore.

​

i adopted this new crappery with the one standard image and picking my runtime but still cant figure out how to build anything because docker isnt started in these new images.

​

if i just do the runtime.. none of the docker command works because docker isnt started in the image by default anymore

phases:

install:

runtime-versions:

docker: 18

[Container] 2019/05/17 17:18:16 Running command docker build -f $DOCKERFILE -t $IMAGE_REPO_NAME:$IMAGE_TAG -t $IMAGE_REPO_NAME:latest .

time="2019-05-17T17:18:16Z" level=error msg="failed to dial gRPC: cannot connect to the Docker daemon. Is 'docker daemon' running on this host?: dial unix /var/run/docker.sock: connect: no such file or directory"

context canceled

​

i tried to start daemon based on instructions for building custom images https://docs.aws.amazon.com/codebuild/latest/userguide/sample-docker-custom-image.html

​

commands:

- nohup /usr/local/bin/dockerd --host=unix:///var/run/docker.sock --host=tcp://127.0.0.1:2375 --storage-driver=overlay2&

- timeout 15 sh -c "until docker info; do echo .; sleep 1; done"

​

​

but it doesnt work either

Error starting daemon: Error initializing network controller: error obtaining controller instance: failed to create NAT chain DOCKER: iptables failed: iptables -t nat -N DOCKER: iptables v1.6.1: can't initialize iptables table `nat': Permission denied (you must be root)

Perhaps iptables or your kernel needs to be upgraded.

(exit status 3)

Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?

​

​

​

I have already lost two days of productivity trying to glass maze through this unexpected change... has anyone figure this out? or is my time better spent moving away from aws codebuild and codepipeline.. i cant live with these types of changes being so disruptive

1
aquaponicbrian•

for anyone having the same problem, i somehow backed into the solution on accident by checking the privileged mode environment flag.. now, if i try to start docker manually i have permissions for that iptables command and whatever.. still extra steps that were not there before and either i am blind or it wasnt documented in the release/change notes i read..

​

ref: https://docs.aws.amazon.com/codebuild/latest/userguide/sample-docker-custom-image.html

​

i guess its low risk for the build to be running privileged user but i would definitely prefer to not. seems sloppy

1