Skip to content

Commit

Permalink
Added new image: Standard 2.0 image with base Ubuntu 18.04
Browse files Browse the repository at this point in the history
  • Loading branch information
srikanthataws committed May 1, 2019
1 parent 710fe96 commit 1794fe6
Show file tree
Hide file tree
Showing 7 changed files with 686 additions and 11 deletions.
18 changes: 9 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,24 +8,24 @@ The master branch will sometimes have changes that are still in the process of b

### How to build Docker images

Steps to build Ruby 2.3.1 image
Steps to build Standard 2.0 image

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

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

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

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

### Image maintenance
Expand All @@ -34,5 +34,5 @@ Some of the images in this repository are no longer actively maintained by AWS C

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

+ [standard 1.0](ubuntu/standard/1.0)
+ [standard 2.0](ubuntu/standard/2.0)

4 changes: 2 additions & 2 deletions buildspec.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@ version: 0.2
phases:
build:
commands:
- cd $CODEBUILD_SRC_DIR/ubuntu/standard/1.0
- docker build -t aws/codebuild/standard:1.0 .
- cd $CODEBUILD_SRC_DIR/ubuntu/standard/2.0
- docker build -t aws/codebuild/standard:2.0 .
528 changes: 528 additions & 0 deletions ubuntu/standard/2.0/Dockerfile

Large diffs are not rendered by default.

23 changes: 23 additions & 0 deletions ubuntu/standard/2.0/dockerd-entrypoint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
#!/bin/sh
set -e

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


tries=0
d_timeout=60
until docker info >/dev/null 2>&1
do
if [ "$tries" -gt "$d_timeout" ]; then
cat /var/log/docker.log
echo 'Timed out trying to connect to internal docker host.' >&2
exit 1
fi
tries=$(( $tries + 1 ))
sleep 1
done

eval "$@"
91 changes: 91 additions & 0 deletions ubuntu/standard/2.0/runtimes.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
version: 0.1

runtimes:
android:
versions:
28:
requires:
java: ["openjdk8"]
commands:
- echo "Installing Android version 28 ..."
java:
versions:
openjdk11:
commands:
- echo "Installing Java version 11 ..."

- export JAVA_HOME="$JAVA_11_HOME"

- export JRE_HOME="$JRE_11_HOME"

- export JDK_HOME="$JDK_11_HOME"

- |-
for tool_path in "$JAVA_HOME"/bin/*;
do tool=`basename "$tool_path"`;
if [ $tool != 'java-rmi.cgi' ];
then
update-alternatives --list "$tool" | grep -q "$tool_path" \
&& update-alternatives --set "$tool" "$tool_path";
fi;
done
openjdk8:
commands:
- echo "Installing Java version 8 ..."

- export JAVA_HOME="$JAVA_8_HOME"

- export JRE_HOME="$JRE_8_HOME"

- export JDK_HOME="$JDK_8_HOME"

- |-
for tool_path in "$JAVA_8_HOME"/bin/* "$JRE_8_HOME"/bin/*;
do tool=`basename "$tool_path"`;
if [ $tool != 'java-rmi.cgi' ];
then
update-alternatives --list "$tool" | grep -q "$tool_path" \
&& update-alternatives --set "$tool" "$tool_path";
fi;
done
golang:
versions:
1.12:
commands:
- echo "Installing Go version 1.12 ..."
python:
versions:
3.7:
commands:
- echo "Installing Python version 3.7 ..."
php:
versions:
7.3:
commands:
- echo "Installing PHP version 7.3 ..."
ruby:
versions:
2.6:
commands:
- echo "Installing Ruby version 2.6 ..."
- rbenv global 2.6.2
nodejs:
versions:
10:
commands:
- echo "Installing Node.js version 10 ..."
- n 10.15.3
8:
commands:
- echo "Installing Node.js version 8 ..."
- n 8.15.1
docker:
versions:
18:
commands:
- echo "Installing Docker version 18 ..."
dotnet:
versions:
2.2:
commands:
- echo "Installing .NET version 2.2 ..."
3 changes: 3 additions & 0 deletions ubuntu/standard/2.0/ssh_config
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
Host *
ConnectTimeout 10
ConnectionAttempts 10
30 changes: 30 additions & 0 deletions ubuntu/standard/2.0/tools/android-accept-licenses.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
#!/usr/bin/expect -f

set timeout 1800
set cmd [lindex $argv 0]
set licenses [lindex $argv 1]

spawn {*}$cmd
expect {
"Do you accept the license '*'*" {
exp_send "y\r"
exp_continue
}
"Accept? (y/N): " {
exp_send "y\r"
exp_continue
}
"Review licenses that have not been accepted (y/N)? " {
exp_send "y\r"
exp_continue
}
eof
}

lassign [wait] pid spawnid os_error waitvalue

if {$os_error == 0} {
exit $waitvalue
} else {
exit 1
}

0 comments on commit 1794fe6

Please sign in to comment.