Using the ARGS with an IMAGE in docker-compose

Hi @mlcruz,

I found the way to do so.

Please find below a working Docker compose file with the args:

version: '3'
services:
  selenium-node-firefox:
image: selenium/node-firefox:latest
build:
  context: https://github.com/SeleniumHQ/docker-selenium.git
  dockerfile: NodeFirefox/Dockerfile
  args:
    FIREFOX_VERSION: 51.0.1
    GECKODRIVER_VERSION: 0.14.0
links:
  - selenium-hub:hub
environment:
  HUB_PORT_4444_TCP_ADDR: 'hub'
  HUB_PORT_4444_TCP_PORT: 4444
  NODE_MAX_INSTANCES: 3
  NODE_MAX_SESSION: 3
depends_on:
  - selenium-hub
  selenium-node-chrome:
image: selenium/node-chrome:latest
links:
  - selenium-hub:hub
environment:
  HUB_PORT_4444_TCP_ADDR: 'hub'
  HUB_PORT_4444_TCP_PORT: 4444
  NODE_MAX_INSTANCES: 3
  NODE_MAX_SESSION: 3
depends_on:
  - selenium-hub
  selenium-hub:
image: selenium/hub:latest
ports:
  - '4444:4444'
  nginx:
restart: always
image: travix/nginx:1.11.10-alpine
depends_on:
  - selenium-node-chrome
  - selenium-node-firefox
  - selenium-hub
links:
  - selenium-hub:hub
environment:
  OFFLOAD_TO_HOST: 'hub'
  OFFLOAD_TO_PORT: 4444
  SERVICE_NAME: 'selenium-hub'
  HEALTH_CHECK_PATH: '/status'
  ENFORCE_HTTPS: 'false'
volumes:
  - ./private:/etc/ssl/private
ports:
  - '80:4444'
  - '443:443'

However, I am facing another issue.

It seems that Docker-compose cannot resolve the file generate_config.

I will investigate it a bit more for understanding why it doesn’t work.

1 Like