Skip to content

Commit 1794fe6

Browse files
committed
Added new image: Standard 2.0 image with base Ubuntu 18.04
1 parent 710fe96 commit 1794fe6

File tree

7 files changed

+686
-11
lines changed

7 files changed

+686
-11
lines changed

README.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -8,24 +8,24 @@ The master branch will sometimes have changes that are still in the process of b
88

99
### How to build Docker images
1010

11-
Steps to build Ruby 2.3.1 image
11+
Steps to build Standard 2.0 image
1212

1313
* Run `git clone https://github.com/aws/aws-codebuild-docker-images.git` to download this repository to your local machine
14-
* 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.
15-
* Run `docker build -t aws/codebuild/ruby:2.3.1 .` to build Docker image locally
14+
* 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.
15+
* Run `docker build -t aws/codebuild/standard:2.0 .` to build Docker image locally
1616

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

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

2323
```
2424
$ git clone https://github.com/aws/aws-codebuild-docker-images.git
2525
$ cd aws-codebuild-docker-images
26-
$ cd ubuntu/ruby/2.3.1
27-
$ docker build -t aws/codebuild/ruby:2.3.1 .
28-
$ docker run -it --entrypoint sh aws/codebuild/ruby:2.3.1 -c bash
26+
$ cd ubuntu/standard/2.0
27+
$ docker build -t aws/codebuild/standard:2.0 .
28+
$ docker run -it --entrypoint sh aws/codebuild/standard:2.0 -c bash
2929
```
3030

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

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

37-
+ [standard 1.0](ubuntu/standard/1.0)
37+
+ [standard 2.0](ubuntu/standard/2.0)
3838

buildspec.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,5 @@ version: 0.2
33
phases:
44
build:
55
commands:
6-
- cd $CODEBUILD_SRC_DIR/ubuntu/standard/1.0
7-
- docker build -t aws/codebuild/standard:1.0 .
6+
- cd $CODEBUILD_SRC_DIR/ubuntu/standard/2.0
7+
- docker build -t aws/codebuild/standard:2.0 .

ubuntu/standard/2.0/Dockerfile

Lines changed: 528 additions & 0 deletions
Large diffs are not rendered by default.
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
#!/bin/sh
2+
set -e
3+
4+
/usr/local/bin/dockerd \
5+
--host=unix:///var/run/docker.sock \
6+
--host=tcp://127.0.0.1:2375 \
7+
--storage-driver=overlay2 &>/var/log/docker.log &
8+
9+
10+
tries=0
11+
d_timeout=60
12+
until docker info >/dev/null 2>&1
13+
do
14+
if [ "$tries" -gt "$d_timeout" ]; then
15+
cat /var/log/docker.log
16+
echo 'Timed out trying to connect to internal docker host.' >&2
17+
exit 1
18+
fi
19+
tries=$(( $tries + 1 ))
20+
sleep 1
21+
done
22+
23+
eval "$@"

ubuntu/standard/2.0/runtimes.yml

Lines changed: 91 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,91 @@
1+
version: 0.1
2+
3+
runtimes:
4+
android:
5+
versions:
6+
28:
7+
requires:
8+
java: ["openjdk8"]
9+
commands:
10+
- echo "Installing Android version 28 ..."
11+
java:
12+
versions:
13+
openjdk11:
14+
commands:
15+
- echo "Installing Java version 11 ..."
16+
17+
- export JAVA_HOME="$JAVA_11_HOME"
18+
19+
- export JRE_HOME="$JRE_11_HOME"
20+
21+
- export JDK_HOME="$JDK_11_HOME"
22+
23+
- |-
24+
for tool_path in "$JAVA_HOME"/bin/*;
25+
do tool=`basename "$tool_path"`;
26+
if [ $tool != 'java-rmi.cgi' ];
27+
then
28+
update-alternatives --list "$tool" | grep -q "$tool_path" \
29+
&& update-alternatives --set "$tool" "$tool_path";
30+
fi;
31+
done
32+
openjdk8:
33+
commands:
34+
- echo "Installing Java version 8 ..."
35+
36+
- export JAVA_HOME="$JAVA_8_HOME"
37+
38+
- export JRE_HOME="$JRE_8_HOME"
39+
40+
- export JDK_HOME="$JDK_8_HOME"
41+
42+
- |-
43+
for tool_path in "$JAVA_8_HOME"/bin/* "$JRE_8_HOME"/bin/*;
44+
do tool=`basename "$tool_path"`;
45+
if [ $tool != 'java-rmi.cgi' ];
46+
then
47+
update-alternatives --list "$tool" | grep -q "$tool_path" \
48+
&& update-alternatives --set "$tool" "$tool_path";
49+
fi;
50+
done
51+
golang:
52+
versions:
53+
1.12:
54+
commands:
55+
- echo "Installing Go version 1.12 ..."
56+
python:
57+
versions:
58+
3.7:
59+
commands:
60+
- echo "Installing Python version 3.7 ..."
61+
php:
62+
versions:
63+
7.3:
64+
commands:
65+
- echo "Installing PHP version 7.3 ..."
66+
ruby:
67+
versions:
68+
2.6:
69+
commands:
70+
- echo "Installing Ruby version 2.6 ..."
71+
- rbenv global 2.6.2
72+
nodejs:
73+
versions:
74+
10:
75+
commands:
76+
- echo "Installing Node.js version 10 ..."
77+
- n 10.15.3
78+
8:
79+
commands:
80+
- echo "Installing Node.js version 8 ..."
81+
- n 8.15.1
82+
docker:
83+
versions:
84+
18:
85+
commands:
86+
- echo "Installing Docker version 18 ..."
87+
dotnet:
88+
versions:
89+
2.2:
90+
commands:
91+
- echo "Installing .NET version 2.2 ..."

ubuntu/standard/2.0/ssh_config

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
Host *
2+
ConnectTimeout 10
3+
ConnectionAttempts 10
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
#!/usr/bin/expect -f
2+
3+
set timeout 1800
4+
set cmd [lindex $argv 0]
5+
set licenses [lindex $argv 1]
6+
7+
spawn {*}$cmd
8+
expect {
9+
"Do you accept the license '*'*" {
10+
exp_send "y\r"
11+
exp_continue
12+
}
13+
"Accept? (y/N): " {
14+
exp_send "y\r"
15+
exp_continue
16+
}
17+
"Review licenses that have not been accepted (y/N)? " {
18+
exp_send "y\r"
19+
exp_continue
20+
}
21+
eof
22+
}
23+
24+
lassign [wait] pid spawnid os_error waitvalue
25+
26+
if {$os_error == 0} {
27+
exit $waitvalue
28+
} else {
29+
exit 1
30+
}

0 commit comments

Comments
 (0)