Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Inconsistent interpretation of environment in docker-compose #1220

Closed
leiblix opened this issue Mar 30, 2015 · 3 comments
Closed

Inconsistent interpretation of environment in docker-compose #1220

leiblix opened this issue Mar 30, 2015 · 3 comments

Comments

@leiblix
Copy link

leiblix commented Mar 30, 2015

If I run official image of tomcat with this command:

docker exec -d -e JAVA_OPTS="-Xms5000m -Xmx10000m" tomcat:8
tomcat starts successfully

but if i create docker-compose.yml with this content

tomcat:
  image: tomcat:8
  environment:
    - JAVA_OPTS="-Xms5000m -Xmx10000m"

and then I run:

docker-compose up

I get this output:

Recreating temp_tomcat_1...
Attaching to temp_tomcat_1
tomcat_1 | Invalid initial heap size: -Xms5000m -Xmx10000m
tomcat_1 | Error: Could not create the Java Virtual Machine.
tomcat_1 | Error: A fatal exception has occurred. Program will exit.
temp_tomcat_1 exited with code 1
Gracefully stopping... (press Ctrl+C again to force)

Any ideas what is wrong?

my system:

docker -v
Docker version 1.5.0, build a8a31ef/1.5.0
docker-compose --version
docker-compose 1.1.0
 uname -a
Linux docker.mzk.cz 3.18.7-200.fc21.x86_64 #1 SMP Wed Feb 11 21:53:17 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux
docker -D info
Containers: 11
Images: 40
Storage Driver: btrfs
 Build Version: Btrfs v3.18.1
 Library Version: 101
Execution Driver: native-0.2
Kernel Version: 3.18.7-200.fc21.x86_64
Operating System: Fedora 21 (Twenty One)
CPUs: 2
Total Memory: 15.67 GiB
Name: docker.mzk.cz
ID: GYRC:LL2X:GT6M:IAGQ:UUIN:XQ7Q:WHUY:SICW:IB3Z:FJZP:LCDI:K6LW
Debug mode (server): false
Debug mode (client): true
Fds: 22
Goroutines: 40
EventsListeners: 0
Init SHA1: a2b40aadd44cc16541a4c34c5572d145d2c052d5
Init Path: /usr/libexec/docker/dockerinit
Docker Root Dir: /var/lib/docker
@nayyden
Copy link

nayyden commented Apr 6, 2015

Hi, i think you should change your yaml.
Note that the last line does not begin with dash and uses : instead of =

tomcat:
  image: tomcat:8
  environment:
    JAVA_OPTS: "-Xms5000m -Xmx10000m"

@david-resnick
Copy link

@MartinRumanek

Setting an environment in docker-compose.yml with this

  environment:
    - JAVA_OPTS="-Xms5000m -Xmx10000m"

gives the container this environment (run 'docker inspect' on container to see):

          "JAVA_OPTS= \"-Xms5000m -Xmx10000m\"",

Remove the outer quotes (despite the space in the val) to give catalina.sh values it can work with.

@leiblix
Copy link
Author

leiblix commented May 21, 2015

@david-resnick You're right. Thank you.

@leiblix leiblix closed this as completed May 21, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants