1

I have two simple services: adminer and mysql.

container.yml:

version: "2"
settings:

  conductor_base: debian:stretch
  project_name: Ansible-container

defaults:
  DB_HOST: mysql
  DB_USER: test
  DB_PASS: *********
  DB_NAME: test

services:

  adminer:
    from: adminer
    links:
      - mysql
    ports:
      - 8080:8080

  mysql:
    from: mysql:5.7
    volumes:
      - /home/argonavt/ansible-container/dump.sql:/var/dump.sql
    environment:
      MYSQL_DATABASE: "{{ DB_NAME }}"
      MYSQL_USER: "{{ DB_USER }}"
      MYSQL_PASSWORD: "{{ DB_PASS }}"
      MYSQL_ROOT_PASSWORD: "{{ DB_USER }}{{ DB_PASS }}"

registries: {}

However after building and running there is no /var/dump.sql file on created container and there are no errors when I run it with --debug mode. Moreover, there is one new volume which I didn't define in my container.yml file but somehow it's created:

"Volumes": {
    "/var/lib/mysql": {}
},

How does it work? How does it know that mysql data should be on volume? Why doesn't it see my own volumes?

If I run the same services on docker-compose, everything is fine.

Versions:

  • Ansible Container, version 0.9.2.
  • Docker version 17.09.1-ce.

I would appreciate any help. Thanks.

Argonavt
  • 11
  • 1

1 Answers1

0

Mount the directory not the file, so skip x.sql

lORD
  • 17
  • 5