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

Unable to set SELENIUM_NODE_HOST to {{CONTAINER_IP}} when using swarm/stack #236

@KZachariassen

Description

@KZachariassen

Hi,

I'm trying to deploy selenium on my docker swarm using stack, the problem here is that stack uses go template and will evaluate {{CONTAINER_IP}} on the deployment time. There is currently no way to escape this, so my question is: Could you set the default value of SELENIUM_NODE_HOST
to {{CONTAINER_IP}} so if I don't specify SELENIUM_NODE_HOST in my compose, it will be {{CONTAINER_IP}}?

docker-compose.yml

version: '3.4'

services:
  chrome:
    image: elgalu/selenium
    environment:
      - PICK_ALL_RANDOM_PORTS=true
      - SELENIUM_HUB_HOST=hub
      - SELENIUM_HUB_PORT=4444
      - SELENIUM_NODE_HOST={{CONTAINER_IP}}
      - VNC_FROM_PORT=${VNC_FROM_PORT-40650}
      - VNC_TO_PORT=${VNC_TO_PORT-40700}
      - SCREEN_WIDTH=1300
      - SCREEN_HEIGHT=999
      - VIDEO=${VIDEO-false}
      - GRID=false
      - CHROME=true
      - FIREFOX=false

docker stack deploy -c .\docker-compose.yml selenium
failed to update service selenium_chrome: Error response from daemon: rpc error: code = InvalidArgument desc = expanding env failed: expanding env "SELENIUM_NODE_HOST={{CONTAINER_IP}}": template: expansion:1: function "CONTAINER_IP" not defined

Operating System

Image version

  • [latest]

Docker version

  • [Docker version 17.12.1-ce, build 7390fc6]

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions