Skip to content
This repository was archived by the owner on Jun 30, 2021. It is now read-only.

Commit 99ebf86

Browse files
committed
Upgrade selenium from 2.46.0 to 2.47.1. Upgrade chrome stable. Add -e MEM_JAVA
1 parent 8a64e8f commit 99ebf86

File tree

9 files changed

+121
-72
lines changed

9 files changed

+121
-72
lines changed

.dockerignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
.gitignore

.gitignore

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,8 @@ tmp/
22
*_image/
33
binaries/
44
READMEBS.md
5+
README-Zala.md
6+
.python-version
57
videos/
6-
8+
android/
9+
binaries

CHANGELOG.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,28 @@ Note sha256 digests are generated after pushing the image to the registry theref
44

55
Note image ids also change after scm-source.json has being updated which triggers a cyclic problem so value TBD will be set here and updated in the [release][] page by navigating into any release tag.
66

7+
## 2.47.1a (2015-07-30)
8+
+ Upgrade selenium from 2.46.0 to 2.47.1 (Leo Gallucci)
9+
+ Upgrade chrome stable to 44.0.2403.125
10+
+ Add -e MEM_JAVA to allow to pass custom values like "1024m".
11+
+ Image tag details:
12+
+ Selenium: v2.47.1 (411b314)
13+
+ Chrome stable: 44.0.2403.125
14+
+ Chrome beta: 45.0.2454.15
15+
+ Chrome dev: 45.0.2454.15
16+
+ Firefox versions in this image:
17+
39.0 38.0.6 37.0.2 36.0.4
18+
35.0.1 34.0.5 33.0.3 32.0.3 31.0 30.0
19+
29.0.1 28.0 27.0.1 26.0 25.0.1 24.0
20+
+ chromedriver: 2.16.333243 (0bfa1d3575fc1044244f21ddb82bf870944ef961)
21+
+ Java: 1.8.0_60-internal OpenJDK 64-Bit 1.8.0_60-b22
22+
+ Timezone: Europe/Berlin
23+
+ Built with: Docker version 1.7.1, build 786b29d
24+
+ FROM ubuntu:wily-20150708
25+
+ Python: 2.7.10
26+
+ Image ID: TBD
27+
+ Digest: sha256:TBD
28+
729
## 2.46.0-06 (2015-07-24)
830
+ Upgrade chrome stable to 44.0.2403.89. (Leo Gallucci)
931
+ Remove letter v from version tags due to github tarball issue.

Dockerfile

Lines changed: 17 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -152,17 +152,6 @@ RUN apt-get update -qqy \
152152
# /usr/lib/jvm/java-8-oracle/jre/lib/security/java.security \
153153
# && rm -rf /var/lib/apt/lists/*
154154

155-
#==============================================================================
156-
# java blocks until kernel have enough entropy to generate the /dev/random seed
157-
#==============================================================================
158-
# This fix is not working so commented out.
159-
# SeleniumHQ/docker-selenium/issues/14
160-
# RUN apt-get update -qqy \
161-
# && apt-get -qqy install \
162-
# haveged rng-tools \
163-
# && service haveged start \
164-
# && update-rc.d haveged defaults
165-
166155
#=======
167156
# Fonts
168157
#=======
@@ -211,8 +200,8 @@ USER ${NORMAL_USER}
211200
#==========
212201
# Selenium
213202
#==========
214-
ENV SEL_MAJOR_MINOR_VER 2.46
215-
ENV SEL_PATCH_LEVEL_VER 0
203+
ENV SEL_MAJOR_MINOR_VER 2.47
204+
ENV SEL_PATCH_LEVEL_VER 1
216205
ENV SEL_HOME ${NORMAL_USER_HOME}/selenium
217206
RUN mkdir -p ${SEL_HOME} \
218207
&& export SELBASE="http://selenium-release.storage.googleapis.com" \
@@ -519,7 +508,7 @@ RUN apt-get update -qqy \
519508
# TODO: Use Google fingerprint to verify downloads
520509
# http://www.google.de/linuxrepositories/
521510
# Also fix .deb file names with correct version
522-
RUN latest_chrome_version_trigger="44.0.2403.89" \
511+
RUN latest_chrome_version_trigger="44.0.2403.107" \
523512
&& mkdir -p ${NORMAL_USER_HOME}/chrome-deb \
524513
&& export CHROME_URL="https://dl.google.com/linux/direct" \
525514
&& wget --no-verbose -O \
@@ -611,6 +600,18 @@ RUN apt-get update -qqy \
611600
ADD supervisor/etc/supervisor/supervisord.conf /etc/supervisor/
612601
ADD **/etc/supervisor/conf.d/* /etc/supervisor/conf.d/
613602

603+
#==============================================
604+
# Java blocks until kernel have enough entropy
605+
# to generate the /dev/random seed
606+
#==============================================
607+
# See: SeleniumHQ/docker-selenium/issues/14
608+
RUN apt-get update -qqy \
609+
&& apt-get -qqy install \
610+
haveged rng-tools \
611+
&& service haveged start \
612+
&& update-rc.d haveged defaults \
613+
&& rm -rf /var/lib/apt/lists/*
614+
614615
#======
615616
# User
616617
#======
@@ -712,6 +713,8 @@ ENV FIREFOX_VERSIONS="${FIREFOX_VERSIONS1}, ${FIREFOX_VERSIONS2}, ${FIREFOX_VERS
712713
VIDEOS_DIR="${NORMAL_USER_HOME}/videos" \
713714
# You can choose what X manager to use
714715
XMANAGER="fluxbox" \
716+
# Java stuff
717+
# MEM_JAVA="1024m" \
715718
#===============================
716719
# Run docker from inside docker
717720
# Usage: docker run -v /var/run/docker.sock:/var/run/docker.sock

README.md

Lines changed: 39 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ Note SeleniumHQ/docker-selenium project is more useful for building selenium gri
1919
In general: add `sudo` only if needed in your environment and `--privileged` if you really need it.
2020

2121
sudo docker run --privileged -p 4444:24444 -p 5920:25900 \
22-
-e VNC_PASSWORD=hola elgalu/selenium:2.46.0-06
22+
-e VNC_PASSWORD=hola elgalu/selenium:2.47.1a
2323

2424
### Non-privileged
2525
### Run
@@ -31,7 +31,7 @@ If your setup is correct, privileged mode and sudo should not be necessary:
3131
-e SCREEN_WIDTH=1920 -e SCREEN_HEIGHT=1080 \
3232
-e VNC_PASSWORD=hola \
3333
-e SSH_AUTH_KEYS="$(cat ~/.ssh/id_rsa.pub)" \
34-
elgalu/selenium:2.46.0-06
34+
elgalu/selenium:2.47.1a
3535

3636
Make sure `docker run` finishes with **selenium all done and ready for testing** else you won't be able to start your tests. To perform this check programatically please use this command where `ch` is the name of the container:
3737

@@ -96,7 +96,7 @@ You can lunch a grid only container via environment variables:
9696

9797
docker run --rm --name=hub -p 4444:24444 -p 5930:25900 -p 2223:22222 \
9898
-p=6081:26080 -e CHROME=false -e FIREFOX=false \
99-
elgalu/selenium:2.46.0-06
99+
elgalu/selenium:2.47.1a
100100

101101
The important part above is `-e CHROME=false -e FIREFOX=false` which tells the docker image not run run default chorme and firefox nodes turning the container into a grid-only one.
102102

@@ -112,7 +112,7 @@ You can lunch a node only container via environment variables:
112112
-p 25550:25550 -p 25551:25551 \
113113
-e GRID=false -e CHROME=true -e FIREFOX=true \
114114
-v $(pwd)/videos:/videos \
115-
elgalu/selenium:2.46.0-06
115+
elgalu/selenium:2.47.1a
116116

117117
The important part above is `-e GRID=false` which tells the container to be a node-only node, this this case with 2 browsers `-e CHROME=true -e FIREFOX=true` but could be just 1.
118118

@@ -137,9 +137,9 @@ There are also additional steps you can take to ensure you're using the correct
137137

138138
You can simply verify that image id is indeed the correct one.
139139

140-
# e.g. full image id for tag 2.46.0-06
141-
export IMGID=7d6df22491ed41ec6474b5bf9a48f453dc0d835ce257f39e02cd5fe356a2c1bb
142-
if docker inspect -f='{{.Id}}' elgalu/selenium:2.46.0-06 |grep ${IMGID} &> /dev/null; then
140+
# e.g. full image id for tag 2.47.1a
141+
export IMGID=TBD
142+
if docker inspect -f='{{.Id}}' elgalu/selenium:2.47.1a |grep ${IMGID} &> /dev/null; then
143143
echo "Image ID tested ok"
144144
else
145145
echo "Image ID doesn't match"
@@ -149,8 +149,8 @@ You can simply verify that image id is indeed the correct one.
149149

150150
Given docker.io currently allows to push the same tag image twice this represent a security concern but since docker >= 1.6.2 is possible to fetch the digest sha256 instead of the tag so you can be sure you're using the exact same docker image every time:
151151

152-
# e.g. sha256 for tag 2.46.0-06
153-
export SHA=fe49be13887bb390ca4f6d3617fd8f34c6a84bc08319bb4f18555ed7d6045f08
152+
# e.g. sha256 for tag 2.47.1a
153+
export SHA=TBD
154154
docker pull elgalu/selenium@sha256:${SHA}
155155

156156
You can find all digests sha256 and image ids per tag in the [CHANGELOG](./CHANGELOG.md) so as of now you just need to trust the sha256 in the CHANGELOG. Bullet proof is to fork this project and build the images yourself if security is a big concern.
@@ -169,7 +169,7 @@ Host machine, terminal 2:
169169
docker run --rm --name=ch -p=4470:24444 \
170170
-e SCREEN_WIDTH -e SCREEN_HEIGHT -e XE_DISP_NUM \
171171
-v /tmp/.X11-unix/X${XE_DISP_NUM}:/tmp/.X11-unix/X${XE_DISP_NUM} \
172-
elgalu/selenium:2.46.0-06
172+
elgalu/selenium:2.47.1a
173173

174174
Now when you run your tests instead of connecting. If docker run fails try `xhost +`
175175

@@ -191,7 +191,7 @@ ANYPORT=0
191191
REMOTE_DOCKER_SRV=localhost
192192
CONTAINER=$(docker run -d -p=0.0.0.0:${ANYPORT}:22222 -p=0.0.0.0:${ANYPORT}:24444 \
193193
-p=0.0.0.0:${ANYPORT}:25900 -e SCREEN_HEIGHT=1110 -e VNC_PASSWORD=hola \
194-
-e SSH_AUTH_KEYS="$(cat ~/.ssh/id_rsa.pub)" elgalu/selenium:2.46.0-06
194+
-e SSH_AUTH_KEYS="$(cat ~/.ssh/id_rsa.pub)" elgalu/selenium:2.47.1a
195195
196196
# -- Option 2.docker run- Running docker on remote docker server like in the cloud
197197
# Useful if the docker server is running in the cloud. Establish free local ports
@@ -201,7 +201,7 @@ ssh ${REMOTE_DOCKER_SRV} #get into the remote docker provider somehow
201201
# it acts as a jump host so my public key is already on that server
202202
CONTAINER=$(docker run -d -p=0.0.0.0:${ANYPORT}:22222 -e SCREEN_HEIGHT=1110 \
203203
-e VNC_PASSWORD=hola -e SSH_AUTH_KEYS="$(cat ~/.ssh/authorized_keys)" \
204-
elgalu/selenium:2.46.0-06
204+
elgalu/selenium:2.47.1a
205205
206206
# -- Common: Wait for the container to start
207207
./host-scripts/wait-docker-selenium.sh ch 7s
@@ -272,7 +272,7 @@ If you git clone this repo locally, i.e. cd into where the Dockerfile is, you ca
272272
273273
If you prefer to download the final built image from docker you can pull it, personally I always prefer to build them manually except for the base images like Ubuntu 14.04.2:
274274
275-
docker pull elgalu/selenium:2.46.0-06
275+
docker pull elgalu/selenium:2.47.1a
276276
277277
#### 2. Use this image
278278
@@ -334,10 +334,30 @@ All output is sent to stdout so it can be inspected by running:
334334
$ docker logs -f <container-id|container-name>
335335
```
336336
337-
Container leaves a few logs files to see what happened:
337+
Powered by Supervisor, the container leaves many logs;
338+
339+
/var/log/sele/docker-selenium-status.log
340+
/var/log/sele/novnc-stderr.log
341+
/var/log/sele/novnc-stdout.log
342+
/var/log/sele/selenium-hub-stderr.log
343+
/var/log/sele/selenium-hub-stdout.log
344+
/var/log/sele/selenium-node-chrome-stderr.log
345+
/var/log/sele/selenium-node-chrome-stdout.log
346+
/var/log/sele/selenium-node-firefox-stderr.log
347+
/var/log/sele/selenium-node-firefox-stdout.log
348+
/var/log/sele/sshd-stderr.log
349+
/var/log/sele/sshd-stdout.log
350+
/var/log/sele/supervisord.log
351+
/var/log/sele/video-rec-stderr.log
352+
/var/log/sele/video-rec-stdout.log
353+
/var/log/sele/vnc-stderr.log
354+
/var/log/sele/vnc-stdout.log
355+
/var/log/sele/xmanager-stderr.log
356+
/var/log/sele/xmanager-stdout.log
357+
/var/log/sele/xterm-stderr.log
358+
/var/log/sele/xterm-stdout.log
359+
/var/log/sele/xvfb-stderr.log
360+
/var/log/sele/xvfb-stdout.log
361+
362+
### Versioning
338363
339-
/tmp/Xvfb_headless.log
340-
/tmp/xmanager.log
341-
/tmp/x11vnc_forever.log
342-
/tmp/local-sel-headless.log
343-
/tmp/selenium-server-standalone.log

READMELeo.md

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
## Build
22

3-
time (docker build -t="elgalu/selenium:2.46.0-06" . ;echo $?;beep)
4-
docker run --rm -ti --name=ch -p=4470:24444 -p=5920:25900 -p=2222:22222 -p=6080:26080 -p=29001:29001 -e SSH_AUTH_KEYS="$(cat ~/.ssh/id_rsa.pub)" -v $(pwd)/videos:/videos -e DISABLE_ROLLBACK=true -e CHROME_FLAVOR=unstable -e FIREFOX_VERSION=38.0.6 -e VIDEO=true -e VIDEO_FILE_NAME=hola -e VIDEO_CHUNK_SECS="00:00:05" elgalu/selenium:2.46.0-06
3+
time (docker build -t="elgalu/selenium:2.47.1a" . ;echo $?;beep)
4+
docker run --rm -ti --name=ch -p=4470:24444 -p=5920:25900 -p=2222:22222 -p=6080:26080 -p=29001:29001 -e SSH_AUTH_KEYS="$(cat ~/.ssh/id_rsa.pub)" -v $(pwd)/videos:/videos -e DISABLE_ROLLBACK=true -e VIDEO=true -e VIDEO_FILE_NAME=hola elgalu/selenium:2.47.1a
55

66
See logs
77

88
docker exec -ti ch bash -c "ls -lah /var/log/sele/"
99

1010
Testing in ssh [email protected]
1111

12-
docker run --rm --name=ch -p=4470:24444 -p=5920:25900 -p=2222:22222 -e SSH_AUTH_KEYS="$(cat ~/.ssh/authorized_keys)" -e VNC_PASSWORD=Hola3 os-registry.stups.zalan.do/tip/selenium:2.46.0-06
12+
docker run --rm --name=ch -p=4470:24444 -p=5920:25900 -p=2222:22222 -e SSH_AUTH_KEYS="$(cat ~/.ssh/authorized_keys)" -e VNC_PASSWORD=Hola3 os-registry.stups.zalan.do/tip/selenium:2.47.1a
1313

1414
## Transfer used browser source artifacts to keep them in the cloud
1515

@@ -32,18 +32,18 @@ List firefox versions via docker exe
3232

3333
## To update image id and digest
3434

35-
docker inspect -f='{{.Id}}' elgalu/selenium:2.46.0-06
35+
docker inspect -f='{{.Id}}' elgalu/selenium:2.47.1a
3636
docker images --digests
3737

3838
## Run with shared dir
3939

4040
docker run --rm --name=ch -p=127.0.0.1:4460:24444 -p=127.0.0.1:5910:25900 \
41-
-v /e2e/uploads:/e2e/uploads elgalu/selenium:2.46.0-06
41+
-v /e2e/uploads:/e2e/uploads elgalu/selenium:2.47.1a
4242
docker run --rm --name=ch -p=4460:24444 -p=5910:25900 \
43-
-v /var/run/docker.sock:/var/run/docker.sock -v $(which docker):$(which docker) elgalu/selenium:2.46.0-06
43+
-v /var/run/docker.sock:/var/run/docker.sock -v $(which docker):$(which docker) elgalu/selenium:2.47.1a
4444

4545

46-
docker run --rm --name=ff -p=127.0.0.1:4461:24444 -p=127.0.0.1:5911:25900 -v /e2e/uploads:/e2e/uploads elgalu/selenium:2.46.0-06
46+
docker run --rm --name=ff -p=127.0.0.1:4461:24444 -p=127.0.0.1:5911:25900 -v /e2e/uploads:/e2e/uploads elgalu/selenium:2.47.1a
4747

4848
## Run without shared dir and bind ports to all network interfaces
4949

@@ -66,11 +66,11 @@ List firefox versions via docker exe
6666
## Run without dir and bind to all interfaces
6767
Note anything after the image will be taken as arguments for the cmd/entrypoint
6868

69-
docker run --rm --name=ch -p=0.0.0.0:8813:8484 -p=0.0.0.0:2222:2222 -p=0.0.0.0:4470:24444 -p=0.0.0.0:5920:25900 -e SCREEN_WIDTH=1800 -e SCREEN_HEIGHT=1110 -e VNC_PASSWORD=hola -e SSH_AUTH_KEYS="$(cat ~/.ssh/id_rsa.pub)" elgalu/selenium:2.46.0-06
69+
docker run --rm --name=ch -p=0.0.0.0:8813:8484 -p=0.0.0.0:2222:2222 -p=0.0.0.0:4470:24444 -p=0.0.0.0:5920:25900 -e SCREEN_WIDTH=1800 -e SCREEN_HEIGHT=1110 -e VNC_PASSWORD=hola -e SSH_AUTH_KEYS="$(cat ~/.ssh/id_rsa.pub)" elgalu/selenium:2.47.1a
7070

71-
docker run --rm --name=ch -p=4470:24444 -p=5920:25900 -e VNC_PASSWORD=hola elgalu/selenium:2.46.0-06
72-
docker run --rm --name=ch -p=4470:24444 -p=5920:25900 -e VNC_PASSWORD=hola docker.io/elgalu/selenium:2.46.0-06
73-
docker run --rm --name=ch -p=0.0.0.0:4470:24444 -p=0.0.0.0:5920:25900 --add-host myserver.dev:172.17.42.1 elgalu/selenium:2.46.0-06
71+
docker run --rm --name=ch -p=4470:24444 -p=5920:25900 -e VNC_PASSWORD=hola elgalu/selenium:2.47.1a
72+
docker run --rm --name=ch -p=4470:24444 -p=5920:25900 -e VNC_PASSWORD=hola docker.io/elgalu/selenium:2.47.1a
73+
docker run --rm --name=ch -p=0.0.0.0:4470:24444 -p=0.0.0.0:5920:25900 --add-host myserver.dev:172.17.42.1 elgalu/selenium:2.47.1a
7474

7575
However adding a custom host IP to server-selenium.local (e.g. bsele ssh config) is more work:
7676

@@ -79,32 +79,32 @@ However adding a custom host IP to server-selenium.local (e.g. bsele ssh config)
7979

8080
vncv localhost:5920 -Scaling=60% &
8181

82-
docker run --rm --name=ff -p=0.0.0.0:4471:24444 -p=0.0.0.0:5921:25900 elgalu/selenium:2.46.0-06
82+
docker run --rm --name=ff -p=0.0.0.0:4471:24444 -p=0.0.0.0:5921:25900 elgalu/selenium:2.47.1a
8383

8484
Automatic builds not working for me right now, maybe there is an issue with docker registry v1 vs v2
8585
https://registry.hub.docker.com/u/elgalu/docker-selenium/builds_history/31621/
8686

8787
## Push version
8888

8989
docker login
90-
docker push docker.io/elgalu/selenium:2.46.0-06 ;echo $?;beep
91-
docker tag elgalu/selenium:2.46.0-06 elgalu/selenium:latest
90+
docker push docker.io/elgalu/selenium:2.47.1a ;echo $?;beep
91+
docker tag elgalu/selenium:2.47.1a elgalu/selenium:latest
9292
docker push docker.io/elgalu/selenium:latest
9393

9494
Not working maybe because it has automated builds enabled but then it fails in the cloud but works locally
9595
https://registry.hub.docker.com/u/elgalu/selenium/tags/manage/
9696

97-
docker push elgalu/selenium:2.46.0-06
98-
docker push elgalu/docker-selenium:2.46.0-06
99-
docker push docker.io/elgalu/docker-selenium:2.46.0-06
97+
docker push elgalu/selenium:2.47.1a
98+
docker push elgalu/docker-selenium:2.47.1a
99+
docker push docker.io/elgalu/docker-selenium:2.47.1a
100100

101101
## Pulling
102102

103-
docker pull registry.hub.docker.com/elgalu/selenium:2.46.0-06
103+
docker pull registry.hub.docker.com/elgalu/selenium:2.47.1a
104104

105105
## Pull
106106

107-
docker run -d --name=max -p=0.0.0.0:4411:24444 -p=0.0.0.0:5911:25900 elgalu/selenium:2.46.0-06
107+
docker run -d --name=max -p=0.0.0.0:4411:24444 -p=0.0.0.0:5911:25900 elgalu/selenium:2.47.1a
108108

109109
How to connect through vnc (need a vnc client)
110110

host-scripts/get-host-scripts-and-dump.sh renamed to host-scripts/get-host-scripts.sh

Lines changed: 14 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
set -e
55

66
BASEURL="https://github.com/elgalu/docker-selenium"
7-
CURVERSION="2.46.0-06"
7+
CURVERSION="2.47.1a"
88
HSVERDIR="docker-selenium-${CURVERSION}/host-scripts"
99

1010
if [ ! -f "${CURVERSION}.zip" ]; then
@@ -21,17 +21,16 @@ if [ -f "${CURVERSION}.zip" ]; then
2121
rm ${CURVERSION}.zip
2222
fi
2323

24-
for i in $(seq 0 3); do
25-
FILENAME="${CURVERSION}.tar--part0${i}"
26-
DOWNPART="${BASEURL}/releases/download/${CURVERSION}/${FILENAME}"
27-
if [ ! -f "${FILENAME}" ]; then
28-
echo "Downloading '${FILENAME}' ..."
29-
wget -nv "${DOWNPART}"
30-
fi
31-
done
32-
33-
# Join
34-
if [ ! -f "${CURVERSION}.tar" ]; then
35-
echo "Joining ${CURVERSION}.tar parts..."
36-
cat ${CURVERSION}.tar--part* > ${CURVERSION}.tar
37-
fi
24+
# for i in $(seq 0 3); do
25+
# FILENAME="${CURVERSION}.tar--part0${i}"
26+
# DOWNPART="${BASEURL}/releases/download/${CURVERSION}/${FILENAME}"
27+
# if [ ! -f "${FILENAME}" ]; then
28+
# echo "Downloading '${FILENAME}' ..."
29+
# wget -nv "${DOWNPART}"
30+
# fi
31+
# done
32+
# # Join
33+
# if [ ! -f "${CURVERSION}.tar" ]; then
34+
# echo "Joining ${CURVERSION}.tar parts..."
35+
# cat ${CURVERSION}.tar--part* > ${CURVERSION}.tar
36+
# fi

java/bin/java-dynamic-memory-opts.sh

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,10 @@ die () {
2222
# JVM uses only 1/4 of system memory by default
2323
# set at Dockerfile or via docker run: MEM_JAVA_PERCENT=80
2424
# Required env vars validations
25-
[ -z "$MEM_JAVA_PERCENT" ] && die "Need to set env var MEM_JAVA_PERCENT"
25+
[ -z "${MEM_JAVA_PERCENT}" ] && die "Need to set env var MEM_JAVA_PERCENT"
2626

2727
MEM_TOTAL_KB=$(cat /proc/meminfo | grep MemTotal | awk '{print $2}')
28-
MEM_JAVA_KB=$(($MEM_TOTAL_KB * $MEM_JAVA_PERCENT / 100))
28+
MEM_JAVA_KB=$((${MEM_TOTAL_KB} * ${MEM_JAVA_PERCENT} / 100))
29+
[ -z "${MEM_JAVA}" ] && export MEM_JAVA="${MEM_JAVA_KB}k"
2930

30-
echo "-Xmx${MEM_JAVA_KB}k"
31+
echo "-Xmx${MEM_JAVA}"

0 commit comments

Comments
 (0)