Skip to content

Commit 097bc04

Browse files
author
rubytester
committed
Merge pull request SeleniumHQ#93 from SeleniumHQ/kayabendroth-feature/upgrade-to-java-8
Kayabendroth feature/upgrade to java 8
2 parents 9a54d3d + e79a227 commit 097bc04

File tree

9 files changed

+42
-27
lines changed

9 files changed

+42
-27
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,6 @@ node_modules/
44
.idea/
55
# Sed backup files.
66
*-e
7+
# Vim swap files.
8+
*.swp
79

Base/Dockerfile

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
FROM ubuntu:14.04
1+
FROM ubuntu:15.04
22
MAINTAINER Selenium <[email protected]>
33

44
#================================================
55
# Customize sources for apt-get
66
#================================================
7-
RUN echo "deb http://archive.ubuntu.com/ubuntu trusty main universe\n" > /etc/apt/sources.list \
8-
&& echo "deb http://archive.ubuntu.com/ubuntu trusty-updates main universe\n" >> /etc/apt/sources.list
7+
RUN echo "deb http://archive.ubuntu.com/ubuntu vivid main universe\n" > /etc/apt/sources.list \
8+
&& echo "deb http://archive.ubuntu.com/ubuntu vivid-updates main universe\n" >> /etc/apt/sources.list
99

1010
#========================
1111
# Miscellaneous packages
@@ -14,11 +14,12 @@ RUN echo "deb http://archive.ubuntu.com/ubuntu trusty main universe\n" > /etc/a
1414
RUN apt-get update -qqy \
1515
&& apt-get -qqy --no-install-recommends install \
1616
ca-certificates \
17-
openjdk-7-jre-headless \
17+
openjdk-8-jre-headless \
18+
sudo \
1819
unzip \
1920
wget \
2021
&& rm -rf /var/lib/apt/lists/* \
21-
&& sed -i 's/\/dev\/urandom/\/dev\/.\/urandom/' ./usr/lib/jvm/java-7-openjdk-amd64/jre/lib/security/java.security
22+
&& sed -i 's/\/dev\/urandom/\/dev\/.\/urandom/' ./usr/lib/jvm/java-8-openjdk-amd64/jre/lib/security/java.security
2223

2324
#==========
2425
# Selenium

NodeChrome/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ RUN wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key
1717
#==================
1818
# Chrome webdriver
1919
#==================
20-
ENV CHROME_DRIVER_VERSION 2.16
20+
ENV CHROME_DRIVER_VERSION 2.18
2121
RUN wget --no-verbose -O /tmp/chromedriver_linux64.zip http://chromedriver.storage.googleapis.com/$CHROME_DRIVER_VERSION/chromedriver_linux64.zip \
2222
&& rm -rf /opt/selenium/chromedriver \
2323
&& unzip /tmp/chromedriver_linux64.zip -d /opt/selenium \

NodeChrome/Dockerfile.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ RUN wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key
1616
#==================
1717
# Chrome webdriver
1818
#==================
19-
ENV CHROME_DRIVER_VERSION 2.16
19+
ENV CHROME_DRIVER_VERSION 2.18
2020
RUN wget --no-verbose -O /tmp/chromedriver_linux64.zip http://chromedriver.storage.googleapis.com/$CHROME_DRIVER_VERSION/chromedriver_linux64.zip \
2121
&& rm -rf /opt/selenium/chromedriver \
2222
&& unzip /tmp/chromedriver_linux64.zip -d /opt/selenium \

README.md

Lines changed: 17 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,15 @@ Images included:
2121
- __selenium/node-firefox-debug__: Selenium node with Firefox installed and runs a VNC server, needs to be connected to a Selenium Grid Hub
2222

2323
## Running the images
24+
25+
When executing docker run for an image with chrome browser please add volume mount `-v /dev/shm:/dev/shm` to use the host's shared memory.
26+
27+
``` bash
28+
$ docker run -d -p 4444:4444 -v /dev/shm:/dev/shm selenium/standalone-chrome:2.47.1
29+
```
30+
31+
This is a workaround to node-chrome crash in docker container issue: https://code.google.com/p/chromium/issues/detail?id=519952
32+
2433

2534
### Standalone Chrome and Firefox
2635

@@ -57,10 +66,10 @@ $ docker run -d -p 4444:4444 -e JAVA_OPTS=-Xmx512m --name selenium-hub selenium/
5766

5867
## Building the images
5968

60-
Ensure you have the `ubuntu:14.04` base image downloaded, this step is _optional_ since Docker takes care of downloading the parent base image automatically.
69+
Ensure you have the `ubuntu:15.04` base image downloaded, this step is _optional_ since Docker takes care of downloading the parent base image automatically.
6170

6271
``` bash
63-
$ docker pull ubuntu:14.04
72+
$ docker pull ubuntu:15.04
6473
```
6574

6675
Clone the repo and from the project directory root you can build everything by running:
@@ -140,12 +149,12 @@ RUN x11vnc -storepasswd <your-password-here> /home/seluser/.vnc/passwd
140149
$ docker images
141150
#=>
142151
REPOSITORY TAG IMAGE ID CREATED VIRTUAL SIZE
143-
selenium/node-firefox 2.45.0 c7c0c99afabd 31 minutes ago 695.9 MB
144-
selenium/node-chrome 2.45.0 c4cd17423321 31 minutes ago 796.7 MB
145-
selenium/node-base 2.45.0 4f7c1788fe4c 32 minutes ago 584.8 MB
146-
selenium/hub 2.45.0 427462f54676 35 minutes ago 431.4 MB
147-
selenium/base 2.45.0 9126579ae96e 35 minutes ago 431.4 MB
148-
ubuntu 14.04 5506de2b643b 3 weeks ago 199.3 MB
152+
selenium/node-firefox 2.47.1 69f762d0d79e 29 minutes ago 552.1 MB
153+
selenium/node-chrome 2.47.1 9dd73160660b 30 minutes ago 723.6 MB
154+
selenium/node-base 2.47.1 1b7a0b7024b1 32 minutes ago 426.1 MB
155+
selenium/hub 2.47.1 2570bbb98229 33 minutes ago 394.4 MB
156+
selenium/base 2.47.1 33478d455dab 33 minutes ago 362.6 MB
157+
ubuntu 15.04 013f3d01d247 6 days ago 131.4 MB
149158
```
150159

151160
### Troubleshooting

Test/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM node:0.10-onbuild
1+
FROM node:0.12.7-onbuild
22
MAINTAINER Selenium <[email protected]>
33

44
ENV TEST_CMD ""

Test/package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@
88
},
99
"license": "Apache 2",
1010
"dependencies": {
11-
"chai": "^1.10.0",
12-
"colors": "^1.0.3",
13-
"wd": "^0.3.11"
11+
"chai": "^3.2.0",
12+
"colors": "^1.1.2",
13+
"wd": "^0.3.12"
1414
}
1515
}

Test/smoke-test.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,17 +25,17 @@ module.exports = function(browserName) {
2525
browser.init({
2626
browserName: browserName
2727
}, function() {
28-
browser.get("https://github.com", function() {
28+
browser.get("https://www.wikipedia.org/", function() {
2929
browser.title(function(err, title) {
3030
if (err) {
3131
console.error(err);
3232
browser.quit();
3333
process.exit(1);
3434
}
3535

36-
title.should.include('GitHub');
36+
title.should.include('Wikipedia');
3737
browser.quit();
38-
});
38+
})
3939
});
4040
});
4141
};

test.sh

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,18 +8,21 @@ fi
88
echo Building test container image
99
docker build -t selenium/test:local ./Test
1010

11-
echo Starting Selenium Container
11+
echo 'Starting Selenium Hub Container...'
1212
HUB=$(docker run -d selenium/hub:2.47.1)
1313
HUB_NAME=$(docker inspect -f '{{ .Name }}' $HUB | sed s:/::)
14-
sleep 2
14+
echo 'Waiting for Hub to come online...'
15+
docker logs -f $HUB &
16+
sleep 4
1517

18+
echo 'Starting Selenium Chrome node...'
1619
NODE_CHROME=$(docker run -d --link $HUB_NAME:hub selenium/node-chrome$DEBUG:2.47.1)
20+
echo 'Starting Selenium Firefox node...'
1721
NODE_FIREFOX=$(docker run -d --link $HUB_NAME:hub selenium/node-firefox$DEBUG:2.47.1)
18-
19-
docker logs -f $HUB &
2022
docker logs -f $NODE_CHROME &
2123
docker logs -f $NODE_FIREFOX &
22-
sleep 2
24+
echo 'Waiting for nodes to register and come online...'
25+
sleep 10
2326

2427
function test_node {
2528
BROWSER=$1

0 commit comments

Comments
 (0)