yaml.scanner.ScannerError: while scanning for the next token found character ‘\t’ that cannot start any token
Use spaces instead of tabs and the error will not persist
Use spaces instead of tabs and the error will not persist
Did you try with quotes on ports? version: ‘2’ services: api: build: context: . dockerfile: webapi/dockerfile ports: – 210 web: build: context: . dockerfile: app/dockerfile ports: – 80 lbapi: image: dockercloud/haproxy links: – api ports: – “8080:210” lbweb: image: dockercloud/haproxy links: – web ports: – “80:80”
This is expected behavior – Compose only does variable interpolation in values, not keys. See here. In my project I use external structure: version: ‘3.1’ services: ### Code from branch develop ### applications: image: registry.gitlab.lc:5000/develop/ed/develop.sources:latest volumes: – developcode:/var/www/develop deploy: replicas: 1 update_config: parallelism: 1 delay: 5s restart_policy: condition: on-failure placement: constraints: [node.role == manager] ### … Read more
As mentioned in a doc, or the help of docker-compose up, –build: build images before starting containers. –force-recreate: Recreate containers even if their configuration and image haven’t changed. –build is a straightforward and it will create the docker images before starting the containers. The –force-recreate flag will stop the currently running containers forcefully and spin … Read more
After some googling I’ve found a blog post that touches this problem as I understood it. I’ll cite the most important part here: plain scalars: – a string – a string with a \ backslash that doesn’t need to be escaped – can also use ” quotes ‘ and $ a % lot /&?+ of … Read more
As you can read in this GitHub issue, mounting named volumes now is a thing … since 1.11 or 1.12.). Driver specific options are documented. Some notes from the GitHub thread: docker volume create –opt type=none –opt device=<host path> –opt o=bind If the host path does not exist, it will not be created. Options are passed … Read more
working_dir sets the working directory of the container that is created. It is the same as the –workdir flag to docker run.
The variables are being read by Compose when the file is parsed. But setting environment only provides values to the container, not to the file parsing. If you’re trying to pass those variables into the container, you need to escape them in the command using an extra $ -Dconfig.home=$${CONF_HOME} -Dcomponent.name=LMS -Denv=$${APP_ENV} -Duser.dir=/tmp/ -DLMS_UUID=$${UUID If you’re … Read more
Use the -f param instead –project-directory view details You can use -f flag to specify a path to Compose file that is not located in the current directory docker-compose -f /path/to/docker-compose.yml
With docker-compose 1.6 this should be possible. Create a docker-compose.yml with your common services: service01: image: image01 links: – service02 service02: image: image02 And a second file, docker-compose.prod.yml with your unique services: service03: image: image03 links: – service02 Now you can start service 01, 02 and 03 with this command: docker-compose -f docker-compose.yml -f docker-compose.prod.yml … Read more