GithubHelp home page GithubHelp logo

aws / aws-codebuild-docker-images Goto Github PK

View Code? Open in Web Editor NEW
1.1K 57.0 963.0 836 KB

Official AWS CodeBuild repository for managed Docker images http://docs.aws.amazon.com/codebuild/latest/userguide/build-env-ref.html

License: Other

Shell 4.18% Dockerfile 93.58% Makefile 0.05% Roff 2.19%
codebuild dockerfile aws-codebuild aws

aws-codebuild-docker-images's Introduction

AWS CodeBuild curated Docker images

This repository holds Dockerfiles of official AWS CodeBuild curated Docker images. Please refer to the AWS CodeBuild User Guide for list of environments supported by AWS CodeBuild.

Build Status

The master branch will sometimes have changes that are still in the process of being released in AWS CodeBuild. See the latest released versions of the Dockerfiles here

How to build Docker images

Steps to build Standard 7.0 image

  • Run git clone https://github.com/aws/aws-codebuild-docker-images.git to download this repository to your local machine
  • Run cd aws-codebuild-docker-images/ubuntu/standard/7.0 to change the directory in your local workspace. This is the location of the Standard 7.0 Dockerfile with Ubuntu base.
  • Run docker build -t aws/codebuild/standard:7.0 . to build Docker image locally

To poke around in the image interactively, build it and run: docker run -it --entrypoint sh aws/codebuild/standard:7.0 -c bash

To let the Docker daemon start up in the container, build it and run: docker run -it --privileged aws/codebuild/standard:7.0 bash

$ git clone https://github.com/aws/aws-codebuild-docker-images.git
$ cd aws-codebuild-docker-images
$ cd ubuntu/standard/7.0
$ docker build -t aws/codebuild/standard:7.0 .
$ docker run -it --entrypoint sh aws/codebuild/standard:7.0 -c bash

Image maintenance

Some of the images in this repository are no longer actively maintained by AWS CodeBuild and may no longer build successfully. These images will not receive any further updates. They remain in this repository as a reference for the contents of these images that were previously released by CodeBuild.

The following images are actively maintained by AWS CodeBuild, and are listed in the CodeBuild console.

aws-codebuild-docker-images's People

Contributors

2ps avatar alemagna-aws avatar awsnitin avatar awsstangers avatar awszhen avatar clareliguori avatar colyoonamaz avatar deleugpn avatar derwasp avatar dylan-aws avatar gulinataws avatar johnhanks1 avatar jpculp avatar leoherran-aws avatar linghaoz avatar lzy7977 avatar maanisim avatar markuspeloquin avatar michael-sharewayz avatar minethai avatar naga-aws avatar normj avatar nrdg42 avatar rasarora avatar ryanjarv avatar srikanthataws avatar subinataws avatar tamsky avatar trivikr avatar xgnl avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

aws-codebuild-docker-images's Issues

Ruby Dockerfile incorrectly references environment variables not already defined

I haven't checked other images but in Ruby 2.5.1 you create environment variables in a single ENV line (using the multi-line separator) that is self-referential.

I.e. you have ENV FOO="BAZ" BAR=$FOO which won't work as BAR ends up being unset.

It has to be:

ENV FOO="BAZ"
ENV BAR=$FOO

This error broke bundler for me in the container. Setting the BUNDLE environment variables appropriately in the CodeBuild project rectified the issue.

I am happy to submit a pull request if you agree this is an issue that should be fixed. I think it should be!

The specific location of the problem is this part where BUNDLE environment variables reference GEM_HOME:

aws-codebuild-docker-images/ubuntu/ruby/2.5.1/Dockerfile

docker layer caching support

How can I enable caching of docker layers between builds? Caching is one of the biggest benefits of multi-stage builds but in CodeBuild it runs every step every time.

Local CodeBuild not prints stdout from images

I try to build locally, but there aren't any stdout from the running image printed for each buildspec command. Was it expected? Do we have an option to turn it on? My debugging process relies on the command output.

Thanks

screenshot from 2018-05-15 15-22-32

Underlying EC2 environment information

I would like to run these images on EC2 to accelerate development against CodeBuild.
Could you document the underlying EC2 environment for CodeBuild so we can build an accurate test environment on EC2?

pre-Maven build for Java images

I've noticed when you use any of these Java images to do a Maven build, it is many times slower than a local build. The reason is Maven is always slow the first time you run a build, because it has to pre-populate its repo with all its basic dependencies / plugins, etc.

The problem is, it is always the first time. Every time CodeBuild uses one of these Java images, it is using a fresh, immutable, stateless copy of the Docker image (as it should). So the first 30 seconds of your build you are waiting for Maven to populate itself.

So I'd suggest RUNning a simple "mvn clean" or something against a trivial POM as one of the last things in the Dockerfile. This will capture all of the basic Maven gunk into the image itself, making thousands (millions?) of subsequent builds faster. Gradle will be faster too for the same reason.

Local build log verbosity

How can one control the logging verbosity for local builds? Currently, only the [Container] messages are being shown, which makes it difficult to debug build issues.

Local build on mac: runtime error: invalid memory address or nil pointer dereference

On MacOS High Sierra 10.13.4 i did pull latest to avoid another mac issue

docker pull amazon/aws-codebuild-local:latest --disable-content-trust=false

I downloaded and built the jre8-image from here.

I get the following stacktrace. I simply have no idea what could be wrong.

$ docker run -it -v /var/run/docker.sock:/var/run/docker.sock -e "IMAGE_NAME=aws/codebuild/java:openjdk-8" -e "ARTIFACTS=/Users/fauxuser/code/artifacts" -e "SOURCE=/Users/fauxuser/code/project" amazon/aws-codebuild-local
Removing agentresources_build_1 ... done
Removing agentresources_agent_1 ... done
Removing network agentresources_default
Removing volume agentresources_user_volume
Removing volume agentresources_source_volume
Creating network "agentresources_default" with the default driver
Creating volume "agentresources_user_volume" with local driver
Creating volume "agentresources_source_volume" with local driver
Creating agentresources_agent_1 ... 
Creating agentresources_agent_1 ... done
Creating agentresources_build_1 ... 
Creating agentresources_build_1 ... done
Attaching to agentresources_agent_1, agentresources_build_1
agent_1  | [Container] 2018/05/25 09:06:00 Waiting for agent ping
agent_1  | [Container] 2018/05/25 09:06:00 Waiting for DOWNLOAD_SOURCE
agent_1  | [Container] 2018/05/25 09:07:04 Phase is DOWNLOAD_SOURCE
agent_1  | [Container] 2018/05/25 09:07:07 CODEBUILD_SRC_DIR=/codebuild/output/src942176067/src
agent_1  | [Container] 2018/05/25 09:07:07 YAML location is /codebuild/output/src942176067/src/buildspec.yml
agent_1  | [Container] 2018/05/25 09:07:07 Processing environment variables
agent_1  | [Container] 2018/05/25 09:07:07 Moving to directory /codebuild/output/src942176067/src
build_1  | panic: runtime error: invalid memory address or nil pointer dereference
build_1  | [signal SIGSEGV: segmentation violation code=0x1 addr=0x8 pc=0x7b672a]
build_1  | 
build_1  | goroutine 1 [running]:
build_1  | amazon/aws/codebuild/container/executor/state/cache.NewCacheImpl(0xc4200c3080, 0xc4200e8ce8, 0xc4200144e0, 0x22, 0xc4201a4448, 0x5, 0xc33920, 0xc4201a0048, 0xc4200144e0, 0x22, ...)
build_1  | 	/home/stangers/AgentWork/src/CoFaContainerBootstrap/src/amazon/aws/codebuild/container/executor/state/cache/impl.go:25 +0xda
build_1  | amazon/aws/codebuild/container/executor/state.(*mainState).downloadCache(0xc42014a100, 0x0, 0x0)
build_1  | 	/home/stangers/AgentWork/src/CoFaContainerBootstrap/src/amazon/aws/codebuild/container/executor/state/cache.go:30 +0x386
build_1  | amazon/aws/codebuild/container/executor/state.(*mainState).Run.func12(0xc42014a100, 0x0, 0x0)
build_1  | 	/home/stangers/AgentWork/src/CoFaContainerBootstrap/src/amazon/aws/codebuild/container/executor/state/run.go:22 +0x2b
build_1  | amazon/aws/codebuild/container/executor/state.(*mainState).Run(0xc42014a100, 0x0, 0x966d2a)
build_1  | 	/home/stangers/AgentWork/src/CoFaContainerBootstrap/src/amazon/aws/codebuild/container/executor/state/run.go:29 +0x156
build_1  | main.main()
build_1  | 	/home/stangers/AgentWork/src/CoFaContainerBootstrap/src/amazon/aws/codebuild/container/executor/main.go:16 +0x70
agentresources_build_1 exited with code 2

Images all require this depends but do not build.

Error Text when running docker build .

The following packages have unmet dependencies:
 libpq-dev : Depends: libpq5 (= 9.3.22-0ubuntu0.14.04) but 9.3.23-0ubuntu0.14.04 is to be installed
E: Unable to correct problems, you have held broken packages.

Local Builds has problem with docker-in-docker-in-docker and source volume

Docker-in-Docker-in-Docker sounds like fun. I am author of the localci which I unfortunately (also fortunately) developed few days before public release of AWS CodeBuild Local Builds. When I read blog post with announcement I was a bit sad but I attempted to finish it to learn how I can manage Docker containers using Golang. Thanks to it I have noticed there is the same problem I had during development localci.

I wanted to prepare tough test for localci if my buildspec.yml will be parsed correctly and also will properly execute CodeBuild job as it would on production server. It uses aws/codebuild/docker:17.09.0 image and in phase there is a command to run a next Docker container (docker-in-docker-in-docker) with a shared volume to compile a Go binary (link to example).

docker run --rm 
    -v "$(pwd)":/gopath/src/sample
    -w "/gopath/src/sample"
    -e "GOPATH=/gopath" \
    golang:1 \
    sh -c "GOOS=linux GOARCH=amd64 CGO_ENABLED=0 go build \
        -a \
        -v \
        -o ./app \
        -ldflags \"-s -w -X main.buildVersion=${SOURCE_VERSION} -X main.buildDate=${CURRENT_DATETIME}\" \
        ./main.go \
        "

Frankly, it might not be complicated for no-gophers but I wanted tough test, huh? In AWS CodeBuild Local Builds it will report following error:

agent_1  | [Container] 2018/05/26 17:26:38 Phase context status code: COMMAND_EXECUTION_ERROR Message: Error while executing command: docker run --rm -v "$(pwd)":/gopath/src/${REPOSITORY_PATH} -w "/gopath/src/${REPOSITORY_PATH}" -e "GOPATH=/gopath" $DOCKER_IMAGE_GO sh -c "GOOS=linux GOARCH=amd64CGO_ENABLED=0 go build -a -v -o ./${BINARY_NAME} -ldflags \"-s -w -X main.buildVersion=${SOURCE_VERSION} -X main.buildDate=${CURRENT_DATETIME}\" $SOURCE_CODE". Reason: exit status 1

It seemed to me similar, because I had the same problem during development the localci - problem with shared volumes:

agent_1  | [Container] 2018/05/26 17:29:45 Running command docker run --rm -v "$(pwd)":/gopath/src/sample -w "/gopath/src/sample" -e "GOPATH=/gopath" golang:1 sh -c ls -laGH
agent_1  |
agent_1  | [Container] 2018/05/26 17:29:46 Phase complete: BUILD Success: true

Empty directory on guest-guest docker? It has also shed some light on the issue. In localci I had to remove the docker.sock as a shared volume (piotrkubisa/localcb@4d07874) between host and guest docker. Then I noticed everything started working just like CodeBuild in AWS cloud.

Today, I tried to replace logic in localci to use AWS CodeBuild Local Builds instead of current state of art and I was also eager to try it after the announcement. Sadly, I need to move on to next project and wait for fixes. I look forward to updates in changelog related to this issue.

java:openjdk-8: Version '5.5.59-*' for 'libmysqlclient-dev' was not found

Problem

I'm unable to build this container locally. Seems like the package is no longer available under that alias

Steps To Reproduce

  1. Clone repository
  2. cd ubuntu/java/openjdk-8
  3. docker build .

Error

During the apt-get install, a MySQL package is not found:

E: Version '5.5.59-*' for 'libmysqlclient-dev' was not found

Build Output

user@gnome:~/docker/aws-codebuild-docker-images/ubuntu/java/openjdk-8$ docker build .
Sending build context to Docker daemon 10.75 kB
Step 1/11 : FROM ubuntu:14.04.5
 ---> 132b7427a3b4
Step 2/11 : ENV DOCKER_BUCKET "download.docker.com" DOCKER_VERSION "17.09.0-ce" DOCKER_CHANNEL "stable" DOCKER_SHA256 "a9e90a73c3cdfbf238f148e1ec0eaff5eb181f92f35bdd938fd7dab18e1c4647" DIND_COMMIT "3b5fac462d21ca164b3778647420016315289034" DOCKER_COMPOSE_VERSION "1.16.1"
 ---> Using cache
 ---> eff956fa4a63
Step 3/11 : RUN apt-get update     && apt-get install -y --no-install-recommends        wget=1.15-* python=2.7.5-* python2.7-dev=2.7.6-* fakeroot=1.20-* ca-certificates        tar=1.27.1-* gzip=1.6-* zip=3.0-* autoconf=2.69-* automake=1:1.14.1-*        bzip2=1.0.6-* file=1:5.14-* g++=4:4.8.2-* gcc=4:4.8.2-* imagemagick=8:6.7.7.10-*        libbz2-dev=1.0.6-* libc6-dev=2.19-* libcurl4-openssl-dev=7.35.0-* libdb-dev=1:5.3.21~*        libevent-dev=2.0.21-stable-* libffi-dev=3.1~rc1+r3.0.13-* libgeoip-dev=1.6.0-* libglib2.0-dev=2.40.2-*        libjpeg-dev=8c-* libkrb5-dev=1.12+dfsg-* liblzma-dev=5.1.1alpha+20120614-*        libmagickcore-dev=8:6.7.7.10-* libmagickwand-dev=8:6.7.7.10-* libmysqlclient-dev=5.5.59-*        libncurses5-dev=5.9+20140118-* libpng12-dev=1.2.50-* libpq-dev=9.3.22-* libreadline-dev=6.3-*        libsqlite3-dev=3.8.2-* libssl-dev=1.0.1f-* libtool=2.4.2-* libwebp-dev=0.4.0-*        libxml2-dev=2.9.1+dfsg1-* libxslt1-dev=1.1.28-* libyaml-dev=0.1.4-* make=3.81-*        patch=2.7.1-* xz-utils=5.1.1alpha+20120614-* zlib1g-dev=1:1.2.8.dfsg-* unzip=6.0-* curl=7.35.0-*        e2fsprogs=1.42.9-* iptables=1.4.21-* xfsprogs=3.1.9ubuntu2 xz-utils=5.1.1alpha+20120614-*     && apt-get install -y -qq less=458-* groff=1.22.2-*     && apt-get -qy build-dep git=1:1.9.1     && apt-get -qy install libcurl4-openssl-dev=7.35.0-* git-man=1:1.9.1-* liberror-perl=0.17-*     && mkdir -p /usr/src/git-openssl     && cd /usr/src/git-openssl     && apt-get source git=1:1.9.1     && cd $(find -mindepth 1 -maxdepth 1 -type d -name "git-*")     && sed -i -- 's/libcurl4-gnutls-dev/libcurl4-openssl-dev/' ./debian/control     && sed -i -- '/TEST\s*=\s*test/d' ./debian/rules     && dpkg-buildpackage -rfakeroot -b     && find .. -type f -name "git_*ubuntu*.deb" -exec dpkg -i \{\} \;     && rm -rf /usr/src/git-openssl     && rm -rf /var/lib/apt/lists/*     && apt-get clean
 ---> Running in 16c6914c1a74
Ign http://archive.ubuntu.com trusty InRelease
Get:1 http://archive.ubuntu.com trusty-updates InRelease [65.9 kB]
Get:2 http://archive.ubuntu.com trusty-security InRelease [65.9 kB]
Get:3 http://archive.ubuntu.com trusty Release.gpg [933 B]
Get:4 http://archive.ubuntu.com trusty Release [58.5 kB]
Get:5 http://archive.ubuntu.com trusty-updates/main Sources [512 kB]
Get:6 http://archive.ubuntu.com trusty-updates/restricted Sources [6449 B]
Get:7 http://archive.ubuntu.com trusty-updates/universe Sources [251 kB]
Get:8 http://archive.ubuntu.com trusty-updates/main amd64 Packages [1334 kB]
Get:9 http://archive.ubuntu.com trusty-updates/restricted amd64 Packages [21.4 kB]
Get:10 http://archive.ubuntu.com trusty-updates/universe amd64 Packages [582 kB]
Get:11 http://archive.ubuntu.com trusty-security/main Sources [197 kB]
Get:12 http://archive.ubuntu.com trusty-security/restricted Sources [5050 B]
Get:13 http://archive.ubuntu.com trusty-security/universe Sources [87.0 kB]
Get:14 http://archive.ubuntu.com trusty-security/main amd64 Packages [909 kB]
Get:15 http://archive.ubuntu.com trusty-security/restricted amd64 Packages [18.1 kB]
Get:16 http://archive.ubuntu.com trusty-security/universe amd64 Packages [286 kB]
Get:17 http://archive.ubuntu.com trusty/main Sources [1335 kB]
Get:18 http://archive.ubuntu.com trusty/restricted Sources [5335 B]
Get:19 http://archive.ubuntu.com trusty/universe Sources [7926 kB]
Get:20 http://archive.ubuntu.com trusty/main amd64 Packages [1743 kB]
Get:21 http://archive.ubuntu.com trusty/restricted amd64 Packages [16.0 kB]
Get:22 http://archive.ubuntu.com trusty/universe amd64 Packages [7589 kB]
Fetched 23.0 MB in 32s (707 kB/s)
Reading package lists...
Reading package lists...
Building dependency tree...
Reading state information...
E: Version '5.5.59-*' for 'libmysqlclient-dev' was not found
The command '/bin/sh -c apt-get update     && apt-get install -y --no-install-recommends        wget=1.15-* python=2.7.5-* python2.7-dev=2.7.6-* fakeroot=1.20-* ca-certificates        tar=1.27.1-* gzip=1.6-* zip=3.0-* autoconf=2.69-* automake=1:1.14.1-*        bzip2=1.0.6-* file=1:5.14-* g++=4:4.8.2-* gcc=4:4.8.2-* imagemagick=8:6.7.7.10-*        libbz2-dev=1.0.6-* libc6-dev=2.19-* libcurl4-openssl-dev=7.35.0-* libdb-dev=1:5.3.21~*        libevent-dev=2.0.21-stable-* libffi-dev=3.1~rc1+r3.0.13-* libgeoip-dev=1.6.0-* libglib2.0-dev=2.40.2-*        libjpeg-dev=8c-* libkrb5-dev=1.12+dfsg-* liblzma-dev=5.1.1alpha+20120614-*        libmagickcore-dev=8:6.7.7.10-* libmagickwand-dev=8:6.7.7.10-* libmysqlclient-dev=5.5.59-*        libncurses5-dev=5.9+20140118-* libpng12-dev=1.2.50-* libpq-dev=9.3.22-* libreadline-dev=6.3-*        libsqlite3-dev=3.8.2-* libssl-dev=1.0.1f-* libtool=2.4.2-* libwebp-dev=0.4.0-*        libxml2-dev=2.9.1+dfsg1-* libxslt1-dev=1.1.28-* libyaml-dev=0.1.4-* make=3.81-*        patch=2.7.1-* xz-utils=5.1.1alpha+20120614-* zlib1g-dev=1:1.2.8.dfsg-* unzip=6.0-* curl=7.35.0-*        e2fsprogs=1.42.9-* iptables=1.4.21-* xfsprogs=3.1.9ubuntu2 xz-utils=5.1.1alpha+20120614-*     && apt-get install -y -qq less=458-* groff=1.22.2-*     && apt-get -qy build-dep git=1:1.9.1     && apt-get -qy install libcurl4-openssl-dev=7.35.0-* git-man=1:1.9.1-* liberror-perl=0.17-*     && mkdir -p /usr/src/git-openssl     && cd /usr/src/git-openssl     && apt-get source git=1:1.9.1     && cd $(find -mindepth 1 -maxdepth 1 -type d -name "git-*")     && sed -i -- 's/libcurl4-gnutls-dev/libcurl4-openssl-dev/' ./debian/control     && sed -i -- '/TEST\s*=\s*test/d' ./debian/rules     && dpkg-buildpackage -rfakeroot -b     && find .. -type f -name "git_*ubuntu*.deb" -exec dpkg -i \{\} \;     && rm -rf /usr/src/git-openssl     && rm -rf /var/lib/apt/lists/*     && apt-get clean' returned a non-zero code: 100

Versions

Host

Linux gnome 4.13.0-38-generic #43~16.04.1-Ubuntu SMP Wed Mar 14 17:48:43 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux

Docker

Docker version 1.13.1, build 092cba3

Ability to alter docker daemon options?

We run our own docker registry in our VPC. Unfortunately in order to push and pull images to it from codebuild we need to add the --insecure-registry flag to docker daemon. It would be great if somehow you could pass along options to the docker daemon.

I've tried killing all running docker and containerd instances and restarting them with new options. It's not going well so far.

Local Builds not working for Mac

I've been trying to follow the example from the AWS article with no success.

Every time I run the build the buildspec.yml file can't be found.

I'm using Docker version 18.03.1-ce, build 9ee9f40 for Mac OS.

Guide on how to run Docker-in-Docker images locally?

Hi, team!

Thanks so much for making the Dockerfiles accessible! I was wondering if it's possible to do a write up on how to run the docker in docker images locally? This would be very useful for debugging purposes!

Local CodeBuild environment variables

Is it possible to pass environment variables to the build container from the command line? This would be really useful to replicate passing environment variables via CodeBuild/CodePipeline configuration, rather than hard-coding into buildspec.yml

Node 8 LTS support?

Elastic Beanstalk has a node 8 support, will there be a node 8 build for codebuild?

I only see node 6.3.1 as the latest.

cannot loign to Amazon ECR on ubuntu/docker/17.09.0 image built by myself

I've tried building both master and 1.2.0.0, none of them let me login to ECR on CodeBuild.
If I use official docker image from Amazon instead, the same command succeeds without errors.
Am I missing something?

15:55:20
[Container] 2018/03/22 06:55:17 Running command $(aws ecr get-login --no-include-email)
15:55:20
WARNING! Using --password via the CLI is insecure. Use --password-stdin.
15:55:20
Warning: failed to get default registry endpoint from daemon (Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?). Using system default: https://index.docker.io/v1/
15:55:20
Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?
15:55:20
15:55:20
[Container] 2018/03/22 06:55:18 Command did not exit successfully $(aws ecr get-login --no-include-email) exit status 1
15:55:20
[Container] 2018/03/22 06:55:18 Phase complete: PRE_BUILD Success: false
15:55:20
[Container] 2018/03/22 06:55:18 Phase context status code: COMMAND_EXECUTION_ERROR Message: Error while executing command: $(aws ecr get-login --no-include-email). Reason: exit status 1

SBT build and sbt docker:publishLocal

Hi, I am working on this problem of building Docker images using sbt feature to generate docker images and content (i.e sbt docker:publishLocal ) for a while now.

This feature would make all Scala Play based micro services to be deployed on to ECS quite easily.

Ideally following steps from a Scala SBT based builds

sbt clean compile test
sbt docker:publishLocal

And later pipeline or something can generate docker images from resulting /target/docker/stage folder

Local CodeBuild agent unable to start.

I've attempted a couple of times to follow the local build instructions through without success. I'm not sure if this is the appropriate place to ask these questions as it's about the amazon/aws-codebuild-local image rather than any of the images in this repo (they all fail equally).

Using Docker version 18.05.0-ce, build f150324 I attempted to run the aws-codebuild-local image with the right parameters to build the java:openjdk-8 example, only to receive the following output:
$ docker run -it --privileged -v /var/run/docker.sock:/var/run/docker.sock -e "IMAGE_NAME=aws/codebuild/java:openjdk-8" -e "ARTIFACTS=/Users/user/Artifacts" -e "SOURCE=/Users/user/code/sample-web-app" amazon/aws-codebuild-local
Error: No such object: docker ...

Seems like an easy one to resolve:

$docker pull docker
Using default tag: latest latest: Pulling from library/docker ... Digest: sha256:eb3f84220dfdb3d37cc5fdee03733fbe4a2c7935eebb5bd93c8f2db4c2b3b63d Status: Downloaded newer image for docker:latest

This then let the first command run through further, though it now fails here:
Creating volume "agentresources_user_volume" with local driver
Creating volume "agentresources_source_volume" with local driver
Pulling agent (sha256:002604018dc2535fe852683d99859313529e77691890ea1591bdef4174c31847)...
ERROR: pull access denied for sha256, repository does not exist or may require docker login

I'm genuinely unsure how to proceed with this. I can't tell if this is an error with the way my local docker repository is set up, if theres a misconfiguration somewhere in the image or if I'm doing something stupid and trying to build this with the wrong version of the docker image.

unbunto/docker/1.12.1 error - "SECONDS: not found"

Trying to run ubuntu/docker/1.12.1/Dockerfile without any alterations, I am seeing this error:

/usr/local/bin/dockerd-entrypoint.sh: 12: /usr/local/bin/dockerd-entrypoint.sh: SECONDS: not found

Tried adding an environment variable for SECONDS with no luck.

Tried:
docker run <IMAGE_ID>

Also tried with cap-add to avoid mount issues:
docker run --cap-add=SYS_ADMIN <IMAGE_ID>

Suggestions? Errors?

Require images for current Ruby versions

The most recent version supported appears to be 2.3.1, whereas the current offical release is 2.5.0 (as of the time of creating this issue)

More generally, is there a mechanism in place to continue to provide images for new versions as they release (and deprecate older ones that are no longer supported)

Docker 17 image can't be built (inconsistent dependencies)

Hi,
When building the docker 17 image I get the error message
libpq-dev : Depends: libpq5 (= 9.3.22-0ubuntu0.14.04) but 9.3.23-0ubuntu0.14.04 is to be installed
Modifying line 23 in the Dockerfile from
libpq-dev=9.3.22-
to
libpq-dev=9.3.23-
Solved this for me. I'd submit a PR but this seems to just defer the problem rather than solve it.
Cheers

How to use dep for a golang build?

I want to use dep (https://golang.github.io/dep) for one of our services. I am using the latest golang image from the official repository (aws/codebuild/golang:1.10). According to the Dockerfile this version is provided with dep out of the box.

In my buildspec I tried this:

  • dep
  • /go/bin/dep

While running my build, however, it fails with the following message:

bash: /go/bin/dep: Permission denied

Feature Request: Amazon Linux docker images

It would be nice if it were possible to use Amazon Linux as the base image for parity with Elastic Beanstalk and other AWS systems.

Using Ubuntu in CI and Amazon Linux for the deployment can create unexpected errors due to minor differences in the environments unless using a docker image deployment.

"docker inspect" requires at least 1 argument.

Context

I'm following the local build support aws codebuild blog. I had a previous problem with the jdk version but got it fixed thanks to #71

Steps to reproduce

Follow the steps from the guide

Problem

When I get to the final part of executing the build of the sample project like:

# Inside sample-web-app directory
mkdir artifacts
docker run -it -v /var/run/docker.sock:/var/run/docker.sock -e "IMAGE_NAME=aws/codebuild/java:openjdk-8" -e "ARTIFACTS=$(pwd)/artifacts" -e "SOURCE=$(pwd)" amazon/aws-codebuild-local

I get the following response

"docker inspect" requires at least 1 argument.
See 'docker inspect --help'.

Usage:  docker inspect [OPTIONS] NAME|ID [NAME|ID...]

Return low-level information on Docker objects
Removing network agentresources_default
Removing volume agentresources_user_volume
Removing volume agentresources_source_volume
Creating network "agentresources_default" with the default driver
Creating volume "agentresources_user_volume" with local driver
Creating volume "agentresources_source_volume" with local driver
Traceback (most recent call last):
  File "bin/docker-compose", line 6, in <module>
  File "compose/cli/main.py", line 68, in main
  File "compose/cli/main.py", line 121, in perform_command
  File "compose/cli/main.py", line 938, in up
  File "compose/project.py", line 430, in up
  File "compose/service.py", line 305, in ensure_image_exists
  File "compose/service.py", line 325, in image
  File "site-packages/docker/utils/decorators.py", line 17, in wrapped
docker.errors.NullResource: Resource ID was not provided
Failed to execute script docker-compose

Versions

Host
Linux 4.15.0-20-generic #21-Ubuntu SMP Tue Apr 24 06:16:15 UTC 2018 GNU/Linux

Docker
Docker version 18.05.0-ce, build f150324

Docker compose
docker-compose version 1.21.2, build a133471


Thanks!

dep doesn't have execution permissions

I tried using dep ensure in one of my projects, and it failed.
So I built the Docker image locally and got this:

root@b58d098173b2:/go# /go/bin/dep ensure
bash: /go/bin/dep: Permission denied
root@b58d098173b2:/go# ls -l /go/bin/dep 
-rw-r--r-- 1 root root 8498976 Jan 25 00:58 /go/bin/dep

Using local AWS credentials for Local CodeBuild

Is it possible to pass through local AWS credentials (e.g. from ~/.aws) to the build container when running CodeBuild locally? This would be ideal when making AWS CLI calls in buildspec.yml. Otherwise, it's not clear how to pass through an ACCESS_KEY_ID and SECRET_ACCESS_KEY to the build container.

Custom image based on Docker 1.12.1 cannot run without --privileged flag

Hi,

I tried to modify to Docker (1.12.1) to build a custom image. When I use this custom image to build my code, the command $(aws ecr get-login) say:

Cannot connect to the Docker daemon. Is the docker daemon running on this host?

It seems that the custom image is not run with --privileged flag as the Official Docker image?

Thanks.

How to get/install python 3.6,zip, Pip in a docker image?

I want to use Python3.6, zip, pip command to install dependency libraries and update Lambda Function in a CodeBuild project.

I tried with 2 options:

  1. Use python 3.5.2 docker image, but it cannot install zip. Error message: Unable to locate package zip
    here is my commands to install zip:
  • apt-get update && apt-get install -y --no-install-recommends
    zip unzip
  • echo zip -v
  1. Use Docker image aws/codebuild/docker:1.12.1 which has pip and zip installed, but I have problem to install Python3.6. Error message: Invalid operation groupinstall. I modified commands from https://stackoverflow.com/questions/44208268/python-3-6-unavailable-in-aws-codebuild-python-3-5-unavailable-in-aws-lambda

Any help is appreciated!
Thanks!

libpq-dev 9.3.20-* unavailable

Hi,

references to libpq-dev=9.3.20-* don't work anymore as the last available package is 9.3.21-*

Sample of errors during builds :

Version '9.3.20-*' for 'libpq-dev' was not found

[Feature request] Ability to customise buildspec file name

I had a look over this and couldn't see a way to do it right now, but it would be great if we could specify the name of the buildspec file as an environment variable as well when you call the build and pass the source and artifact paths. You can choose the filename in the CodeBuild UI so doing it locally would be a nice feature as well. Thanks!

Maven is outdated in openjdk-8 image

I was running a Maven build in CodeBuild, and I got the following:

1) Error injecting: private org.eclipse.aether.spi.log.Logger org.apache.maven.repository.internal.DefaultVersionRangeResolver.logger
  while locating org.apache.maven.repository.internal.DefaultVersionRangeResolver
  while locating java.lang.Object annotated with *
  at org.eclipse.sisu.wire.LocatorWiring
  while locating org.eclipse.aether.impl.VersionRangeResolver
    for parameter 2 at org.eclipse.aether.internal.impl.DefaultDependencyCollector.<init>(Unknown Source)
  while locating org.eclipse.aether.internal.impl.DefaultDependencyCollector
  while locating java.lang.Object annotated with *
  at org.eclipse.sisu.wire.LocatorWiring
  while locating org.eclipse.aether.impl.DependencyCollector
    for parameter 5 at org.eclipse.aether.internal.impl.DefaultRepositorySystem.<init>(Unknown Source)
  while locating org.eclipse.aether.internal.impl.DefaultRepositorySystem
  while locating java.lang.Object annotated with *
  while locating org.apache.maven.artifact.installer.DefaultArtifactInstaller
Caused by: java.lang.IllegalArgumentException: Can not set org.eclipse.aether.spi.log.Logger field org.apache.maven.repository.internal.DefaultVersionRangeResolver.logger to org.eclipse.aether.internal.impl.slf4j.Slf4jLoggerFactory
[backtrace]

Looking into the exception's message, it seemed to have something to do with an outdated Maven. In fact, the Maven version in the openjdk-8 image is 3.3.3. I upgraded the image to use 3.5.3 and my build succeeds.

Cannot build ubuntu/java/openjdk-8

When attempting to build ubuntu/java/openjdk-8, it returns the following error:

E: Version '8u141-b15-3~14.04' for 'openjdk-8-jdk' was not found

xsltproc no longer available on aws/codebuild/python:2.7.12

I believe something changed recently with the docker images that made the xsltproc command disappear from my build environment. It seems to have disappeared between 7:41:50 PM and 8:41:52 PM UTC on June 13th, 2018, according to my AWS CodeBuild logs.

Add support for .NET Core 2.1 SDK

.NET Core 2.1 was officially released May 30, 2018. 2.1 should co-exist with the existing core-1 and core-2 images to avoid breaking existing users.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.