添加链接
link管理
链接快照平台
  • 输入网页链接,自动生成快照
  • 标签化管理网页链接
相关文章推荐
英姿勃勃的黄豆  ·  Getting Started | ...·  3 月前    · 
彷徨的桔子  ·  Zurich Art Weekend | ...·  3 月前    · 

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 "variable is not set. Substituting a blank string." being shown when env variables from links used in directives #2123 "variable is not set. Substituting a blank string." being shown when env variables from links used in directives #2123 shrikrishnaholla opened this issue Oct 1, 2015 · 9 comments · Fixed by #2204

I'm working with master (which is currently at dabf1e8 ), and while building or starting, I'm getting the above warning, and those commands won't work

Ex: I am using a service

rcli:
  image: redis:latest
  links:
    - redis
  command: >
     sh -c 'redis-cli -h "$REDIS_PORT_6379_TCP_ADDR" -p "$REDIS_PORT_6379_TCP_PORT"'

Here, since the env variable REDIS_PORT_6379_TCP_ADDR is obtained because of linking, and it's non-existent when building, or before starting the redis service, I can't use this service. It substitutes the value with an empty string.

The REDIS_PORT_6379_TCP_ADDR variable is not set. Substituting a blank string.
The REDIS_PORT_6379_TCP_PORT variable is not set. Substituting a blank string.
          

This is also reproducible if the CMD directive in the Dockerfile uses any env variable

CMD fluentd --gemfile /etc/fluent/Gemfile -c /fluentd/etc/$FLUENTD_CONF -p /fluentd/plugins $FLUENTD_OPT

Seems like command string is being evaluated or something by compose or docker-py, and that is being done prematurely

I think maybe we should document this error explicitly, I suspect a few more people will hit this on release.

It should only apply to variables in the config though, not the Dockerfile.

@shrikrishnaholla: Docker populate /etc/host inside container with names from link and also do not change ports. But documentation is confusing.

See https://docs.docker.com/compose/env/ for details.

I would just remove port and replace address with name from /etc/hosts

rcli:
  image: redis:latest
  links:
    - redis
  command: >
     sh -c 'redis-cli -h redis '

This should also works. I'm not on computer with docker right now

rcli:
  image: redis:latest
  links:
    - redis
  command: redis-cli -h redis
          

C:\Users\bundalla\Desktop\advancelaravel54\laradock>docker-compose up -d nginx mysql
WARNING: The PMA_USER variable is not set. Defaulting to a blank string.
WARNING: The PMA_PASSWORD variable is not set. Defaulting to a blank string.
WARNING: The PMA_ROOT_PASSWORD variable is not set. Defaulting to a blank string.
WARNING: The PMA_DB_ENGINE variable is not set. Defaulting to a blank string.
WARNING: The PMA_PORT variable is not set. Defaulting to a blank string.
WARNING: The DATA_SAVE_PATH variable is not set. Defaulting to a blank string.
WARNING: The DOCKER_HOST_IP variable is not set. Defaulting to a blank string.
WARNING: The PHP_IDE_CONFIG variable is not set. Defaulting to a blank string.
WARNING: The PHP_FPM_INSTALL_XDEBUG variable is not set. Defaulting to a blank string.
WARNING: The INSTALL_BLACKFIRE variable is not set. Defaulting to a blank string.
WARNING: The PHP_FPM_INSTALL_SOAP variable is not set. Defaulting to a blank string.
WARNING: The PHP_FPM_INSTALL_MONGO variable is not set. Defaulting to a blank string.
WARNING: The PHP_FPM_INSTALL_ZIP_ARCHIVE variable is not set. Defaulting to a blank string.
WARNING: The PHP_FPM_INSTALL_BCMATH variable is not set. Defaulting to a blank string.
WARNING: The PHP_FPM_INSTALL_PHPREDIS variable is not set. Defaulting to a blank string.
WARNING: The PHP_FPM_INSTALL_MEMCACHED variable is not set. Defaulting to a blank string.
WARNING: The PHP_FPM_INSTALL_OPCACHE variable is not set. Defaulting to a blank string.
WARNING: The PHP_FPM_INSTALL_EXIF variable is not set. Defaulting to a blank string.
WARNING: The PHP_FPM_INSTALL_AEROSPIKE_EXTENSION variable is not set. Defaulting to a blank string.
WARNING: The PHP_FPM_INSTALL_MYSQLI variable is not set. Defaulting to a blank string.
WARNING: The PHP_FPM_INSTALL_TOKENIZER variable is not set. Defaulting to a blank string.
WARNING: The PHP_FPM_INSTALL_INTL variable is not set. Defaulting to a blank string.
WARNING: The PHP_FPM_INSTALL_GHOSTSCRIPT variable is not set. Defaulting to a blank string.
WARNING: The PHP_VERSION variable is not set. Defaulting to a blank string.
WARNING: The POSTGRES_DB variable is not set. Defaulting to a blank string.
WARNING: The POSTGRES_USER variable is not set. Defaulting to a blank string.
WARNING: The POSTGRES_PASSWORD variable is not set. Defaulting to a blank string.
WARNING: The POSTGRES_PORT variable is not set. Defaulting to a blank string.
WARNING: The HAPROXY_HOST_HTTP_PORT variable is not set. Defaulting to a blank string.
WARNING: The MYSQL_DATABASE variable is not set. Defaulting to a blank string.
WARNING: The MYSQL_USER variable is not set. Defaulting to a blank string.
WARNING: The MYSQL_PASSWORD variable is not set. Defaulting to a blank string.
WARNING: The MYSQL_ROOT_PASSWORD variable is not set. Defaulting to a blank string.
WARNING: The MYSQL_PORT variable is not set. Defaulting to a blank string.
WARNING: The BLACKFIRE_SERVER_ID variable is not set. Defaulting to a blank string.
WARNING: The BLACKFIRE_SERVER_TOKEN variable is not set. Defaulting to a blank string.
WARNING: The SELENIUM_PORT variable is not set. Defaulting to a blank string.
WARNING: The PHP_SOCKET variable is not set. Defaulting to a blank string.
WARNING: The APACHE_HOST_LOG_PATH variable is not set. Defaulting to a blank string.
WARNING: The APACHE_HOST_HTTP_PORT variable is not set. Defaulting to a blank string.
WARNING: The APACHE_HOST_HTTPS_PORT variable is not set. Defaulting to a blank string.
WARNING: The JENKINS_HOST_SLAVE_AGENT_PORT variable is not set. Defaulting to a blank string.
WARNING: The JENKINS_HOST_HTTP_PORT variable is not set. Defaulting to a blank string.
WARNING: The JENKINS_HOME variable is not set. Defaulting to a blank string.
WARNING: The MEMCACHED_HOST_PORT variable is not set. Defaulting to a blank string.
WARNING: The VARNISH_CONFIG variable is not set. Defaulting to a blank string.
WARNING: The VARNISH_PROXY2_CACHE_SIZE variable is not set. Defaulting to a blank string.
WARNING: The VARNISHD_PARAMS variable is not set. Defaulting to a blank string.
WARNING: The VARNISH_PORT variable is not set. Defaulting to a blank string.
WARNING: The VARNISH_PROXY2_BACKEND_HOST variable is not set. Defaulting to a blank string.
WARNING: The VARNISH_BACKEND_PORT variable is not set. Defaulting to a blank string.
WARNING: The VARNISH_PROXY2_SERVER variable is not set. Defaulting to a blank string.
WARNING: The NGINX_HOST_LOG_PATH variable is not set. Defaulting to a blank string.
WARNING: The NGINX_SITES_PATH variable is not set. Defaulting to a blank string.
WARNING: The NGINX_HOST_HTTP_PORT variable is not set. Defaulting to a blank string.
WARNING: The NGINX_HOST_HTTPS_PORT variable is not set. Defaulting to a blank string.
WARNING: The APPLICATION variable is not set. Defaulting to a blank string.
WARNING: The PERCONA_DATABASE variable is not set. Defaulting to a blank string.
WARNING: The PERCONA_USER variable is not set. Defaulting to a blank string.
WARNING: The PERCONA_PASSWORD variable is not set. Defaulting to a blank string.
WARNING: The PERCONA_ROOT_PASSWORD variable is not set. Defaulting to a blank string.
WARNING: The PERCONA_PORT variable is not set. Defaulting to a blank string.
WARNING: The VARNISH_PROXY1_CACHE_SIZE variable is not set. Defaulting to a blank string.
WARNING: The VARNISH_PROXY1_BACKEND_HOST variable is not set. Defaulting to a blank string.
WARNING: The VARNISH_PROXY1_SERVER variable is not set. Defaulting to a blank string.
WARNING: The MARIADB_DATABASE variable is not set. Defaulting to a blank string.
WARNING: The MARIADB_USER variable is not set. Defaulting to a blank string.
WARNING: The MARIADB_PASSWORD variable is not set. Defaulting to a blank string.
WARNING: The MARIADB_ROOT_PASSWORD variable is not set. Defaulting to a blank string.
WARNING: The MARIADB_PORT variable is not set. Defaulting to a blank string.
WARNING: The MSSQL_DATABASE variable is not set. Defaulting to a blank string.
WARNING: The MSSQL_PASSWORD variable is not set. Defaulting to a blank string.
WARNING: The MSSQL_PORT variable is not set. Defaulting to a blank string.
WARNING: The MINIO_PORT variable is not set. Defaulting to a blank string.
WARNING: The RABBITMQ_DEFAULT_USER variable is not set. Defaulting to a blank string.
WARNING: The RABBITMQ_DEFAULT_PASS variable is not set. Defaulting to a blank string.
WARNING: The RABBITMQ_NODE_HOST_PORT variable is not set. Defaulting to a blank string.
WARNING: The RABBITMQ_MANAGEMENT_HTTP_HOST_PORT variable is not set. Defaulting to a blank string.
WARNING: The RABBITMQ_MANAGEMENT_HTTPS_HOST_PORT variable is not set. Defaulting to a blank string.
WARNING: The ADM_PORT variable is not set. Defaulting to a blank string.
WARNING: The ELASTICSEARCH_HOST_HTTP_PORT variable is not set. Defaulting to a blank string.
WARNING: The ELASTICSEARCH_HOST_TRANSPORT_PORT variable is not set. Defaulting to a blank string.
WARNING: The WORKSPACE_INSTALL_XDEBUG variable is not set. Defaulting to a blank string.
WARNING: The WORKSPACE_INSTALL_SOAP variable is not set. Defaulting to a blank string.
WARNING: The WORKSPACE_INSTALL_MONGO variable is not set. Defaulting to a blank string.
WARNING: The WORKSPACE_INSTALL_NODE variable is not set. Defaulting to a blank string.
WARNING: The WORKSPACE_INSTALL_YARN variable is not set. Defaulting to a blank string.
WARNING: The WORKSPACE_INSTALL_DRUSH variable is not set. Defaulting to a blank string.
WARNING: The WORKSPACE_INSTALL_AEROSPIKE_EXTENSION variable is not set. Defaulting to a blank string.
WARNING: The WORKSPACE_INSTALL_V8JS_EXTENSION variable is not set. Defaulting to a blank string.
WARNING: The WORKSPACE_COMPOSER_GLOBAL_INSTALL variable is not set. Defaulting to a blank string.
WARNING: The WORKSPACE_INSTALL_WORKSPACE_SSH variable is not set. Defaulting to a blank string.
WARNING: The WORKSPACE_INSTALL_LARAVEL_ENVOY variable is not set. Defaulting to a blank string.
WARNING: The WORKSPACE_INSTALL_DEPLOYER variable is not set. Defaulting to a blank string.
WARNING: The WORKSPACE_INSTALL_LINUXBREW variable is not set. Defaulting to a blank string.
WARNING: The WORKSPACE_INSTALL_MC variable is not set. Defaulting to a blank string.
WARNING: The WORKSPACE_PUID variable is not set. Defaulting to a blank string.
WARNING: The WORKSPACE_PGID variable is not set. Defaulting to a blank string.
WARNING: The WORKSPACE_NODE_VERSION variable is not set. Defaulting to a blank string.
WARNING: The WORKSPACE_YARN_VERSION variable is not set. Defaulting to a blank string.
WARNING: The WORKSPACE_TIMEZONE variable is not set. Defaulting to a blank string.
WARNING: The BLACKFIRE_CLIENT_ID variable is not set. Defaulting to a blank string.
WARNING: The BLACKFIRE_CLIENT_TOKEN variable is not set. Defaulting to a blank string.
WARNING: The WORKSPACE_SSH_PORT variable is not set. Defaulting to a blank string.
WARNING: The BEANSTALKD_HOST_PORT variable is not set. Defaulting to a blank string.
ERROR: The Compose file '.\docker-compose.yml' is invalid because:
services.proxy.expose is invalid: should be of the format 'PORT[/PROTOCOL]'
services.proxy2.expose is invalid: should be of the format 'PORT[/PROTOCOL]'
services.memcached.ports is invalid: Invalid port ":11211", should be [[remote_ip:]remote_port[-remote_port]:]port[/protocol]
services.beanstalkd.ports is invalid: Invalid port ":11300", should be [[remote_ip:]remote_port[-remote_port]:]port[/protocol]
services.mssql.ports is invalid: Invalid port ":1433", should be [[remote_ip:]remote_port[-remote_port]:]port[/protocol]
services.rabbitmq.ports is invalid: Invalid port ":15671", should be [[remote_ip:]remote_port[-remote_port]:]port[/protocol]
services.rabbitmq.ports is invalid: Invalid port ":15672", should be [[remote_ip:]remote_port[-remote_port]:]port[/protocol]
services.workspace.ports is invalid: Invalid port ":22", should be [[remote_ip:]remote_port[-remote_port]:]port[/protocol]
services.mariadb.ports is invalid: Invalid port ":3306", should be [[remote_ip:]remote_port[-remote_port]:]port[/protocol]
services.mysql.ports is invalid: Invalid port ":3306", should be [[remote_ip:]remote_port[-remote_port]:]port[/protocol]
services.percona.ports is invalid: Invalid port ":3306", should be [[remote_ip:]remote_port[-remote_port]:]port[/protocol]
services.apache2.ports is invalid: Invalid port ":443", should be [[remote_ip:]remote_port[-remote_port]:]port[/protocol]
services.nginx.ports is invalid: Invalid port ":443", should be [[remote_ip:]remote_port[-remote_port]:]port[/protocol]
services.selenium.ports is invalid: Invalid port ":4444", should be [[remote_ip:]remote_port[-remote_port]:]port[/protocol]
services.jenkins.ports is invalid: Invalid port ":50000", should be [[remote_ip:]remote_port[-remote_port]:]port[/protocol]
services.postgres.ports is invalid: Invalid port ":5432", should be [[remote_ip:]remote_port[-remote_port]:]port[/protocol]
services.postgres-postgis.ports is invalid: Invalid port ":5432", should be [[remote_ip:]remote_port[-remote_port]:]port[/protocol]
services.rabbitmq.ports is invalid: Invalid port ":5672", should be [[remote_ip:]remote_port[-remote_port]:]port[/protocol]
services.apache2.ports is invalid: Invalid port ":80", should be [[remote_ip:]remote_port[-remote_port]:]port[/protocol]
services.nginx.ports is invalid: Invalid port ":80", should be [[remote_ip:]remote_port[-remote_port]:]port[/protocol]
services.phpmyadmin.ports is invalid: Invalid port ":80", should be [[remote_ip:]remote_port[-remote_port]:]port[/protocol]
services.adminer.ports is invalid: Invalid port ":8080", should be [[remote_ip:]remote_port[-remote_port]:]port[/protocol]
services.jenkins.ports is invalid: Invalid port ":8080", should be [[remote_ip:]remote_port[-remote_port]:]port[/protocol]
services.balancer.ports is invalid: Invalid port ":8085", should be [[remote_ip:]remote_port[-remote_port]:]port[/protocol]
services.minio.ports is invalid: Invalid port ":9000", should be [[remote_ip:]remote_port[-remote_port]:]port[/protocol]
services.elasticsearch.ports is invalid: Invalid port ":9200", should be [[remote_ip:]remote_port[-remote_port]:]port[/protocol]
services.elasticsearch.ports is invalid: Invalid port ":9300", should be [[remote_ip:]remote_port[-remote_port]:]port[/protocol]