Docker-Sync问题:自0.4.2

时间:2017-05-11 08:22:12

标签: docker docker-compose

由于我已将Docker-Sync版本更新为0.4.0,然后是0.4.1和0.4.2,每次都会变得更糟。

我试图切换到navive_osx模式,并且同步不能与0.4.0一起使用。日志很好,但同步不再发生了。所以我回到了Unison同步策略。

我已在docker compose中设置:nocopy语句而不是:rw,因为更改日志要求0.4.1没有任何改进。

现在有了0.4.2,我甚至无法同时启动环境。每当我在第二个新终端中启动时,所有内容都会在第一个docker-sync窗口中混淆,如您所见:

ENV1_mysql | 2017-05-10T23:05:19.944798Z 0 [Note] Giving 2 client threads a chance to die gracefully
ENV1_mysql | 2017-05-10T23:05:19.944837Z 0 [Note] Shutting down slave threads
ENV1_redis | 1:signal-handler (1494457519) Received SIGTERM scheduling shutdown...
ENV1_redis | 1:M 10 May 23:05:19.959 # User requested shutdown...
ENV1_redis | 1:M 10 May 23:05:19.959 * Saving the final RDB snapshot before exiting.
ENV1_redis | 1:M 10 May 23:05:19.964 * DB saved on disk
ENV1_redis | 1:M 10 May 23:05:19.964 # Redis is now ready to exit, bye bye...
ENV1_job | 2017-05-10T23:05:20.074Z 1 TID-qhhnw ERROR: Error fetching job: Error connecting to Redis on redis:6379 (Errno::ECONNREFUSED)
ENV1_job | 2017-05-10T23:05:20.074Z 1 TID-qhhnw ERROR: /bundle/gems/redis-3.3.3/lib/redis/client.rb:345:in `rescue in establish_connection'
ENV1_job | 2017-05-10T23:05:20.074Z 1 TID-qhhnw ERROR: /bundle/gems/redis-3.3.3/lib/redis/client.rb:331:in `establish_connection'
ENV1_job | 2017-05-10T23:05:20.074Z 1 TID-qhhnw ERROR: /bundle/gems/redis-3.3.3/lib/redis/client.rb:101:in `block in connect'
ENV1_job | 2017-05-10T23:05:20.074Z 1 TID-qhhnw ERROR: /bundle/gems/redis-3.3.3/lib/redis/client.rb:293:in `with_reconnect'

(.... ENV1_job tons of log...)

ENV1_job | 2017-05-10T23:05:20.255Z 1 TID-qhiv8 ERROR: /bundle/gems/sidekiq-4.2.10/lib/sidekiq/processor.rb:88:in `get_one'
ENV1_job | 2017-05-10T23:05:20.256Z 1 TID-qhiv8 ERROR: /bundle/gems/sidekiq-4.2.10/lib/sidekiq/processor.rb:98:in `fetch'
ENV1_job | 2017-05-10T23:05:20.256Z 1 TID-qhiv8 ERROR: /bundle/gems/sidekiq-4.2.10/lib/sidekiq/processor.rb:81:in `process_one'
ENV1_job | 2017-05-10T23:05:20.256Z 1 TID-qhiv8 ERROR: /bundle/gems/sidekiq-4.2.10/lib/sidekiq/processor.rb:70:in `run'
ENV1_job | 2017-05-10T23:05:20.256Z 1 TID-qhiv8 ERROR: /bundle/gems/sidekiq-4.2.10/lib/sidekiq/util.rb:17:in `watchdog'
ENV1_job | 2017-05-10T23:05:20.256Z 1 TID-qhiv8 ERROR: /bundle/gems/sidekiq-4.2.10/lib/sidekiq/util.rb:26:in `block in safe_thread'
ENV1_redis exited with code 0
ENV2_redis | 1:C 10 May 23:05:21.731 # Warning: no config file specified, using the default config. In order to specify a config file use redis-server /path/to/redis.conf
ENV2_redis |                 _._
ENV2_redis |            _.-``__ ''-._
ENV2_redis |       _.-``    `.  `_.  ''-._           Redis 3.2.8 (00000000/0) 64 bit
ENV2_redis |   .-`` .-```.  ```\/    _.,_ ''-._
ENV2_redis |  (    '      ,       .-`  | `,    )     Running in standalone mode
ENV2_redis |  |`-._`-...-` __...-.``-._|'` _.-'|     Port: 6379
ENV2_redis |  |    `-._   `._    /     _.-'    |     PID: 1
ENV2_redis |   `-._    `-._  `-./  _.-'    _.-'
ENV2_redis |  |`-._`-._    `-.__.-'    _.-'_.-'|
ENV2_redis |  |    `-._`-._        _.-'_.-'    |           http://redis.io
ENV2_redis |   `-._    `-._`-.__.-'_.-'    _.-'
ENV2_redis |  |`-._`-._    `-.__.-'    _.-'_.-'|
ENV2_redis |  |    `-._`-._        _.-'_.-'    |
ENV2_redis |   `-._    `-._`-.__.-'_.-'    _.-'
ENV2_redis |       `-._    `-.__.-'    _.-'
ENV2_redis |           `-._        _.-'
ENV2_redis |               `-.__.-'
ENV2_redis |
ENV2_redis | 1:M 10 May 23:05:21.735 # WARNING: The TCP backlog setting of 511 cannot be enforced because /proc/sys/net/core/somaxconn is set to the lower value of 128.
ENV2_redis | 1:M 10 May 23:05:21.735 # Server started, Redis version 3.2.8
ENV2_redis | 1:M 10 May 23:05:21.735 # WARNING you have Transparent Huge Pages (THP) support enabled in your kernel. This will create latency and memory usage issues with Redis. To fix this issue run the command 'echo never > /sys/kernel/mm/transparent_hugepage/enabled' as root, and add it to your /etc/rc.local in order to retain the setting after a reboot. Redis must be restarted after THP is disabled.
ENV2_redis | 1:M 10 May 23:05:21.740 * DB loaded from disk: 0.004 seconds
ENV2_redis | 1:M 10 May 23:05:21.740 * The server is now ready to accept connections on port 6379
ENV1_mysql | 2017-05-10T23:05:21.946243Z 0 [Note] Forcefully disconnecting 2 remaining clients
ENV1_mysql | 2017-05-10T23:05:21.946330Z 0 [Warning] mysqld: Forcing close of thread 4  user: 'root'
ENV1_mysql |
ENV1_mysql | 2017-05-10T23:05:21.946665Z 0 [Warning] mysqld: Forcing close of thread 3  user: 'root'
ENV1_mysql |
ENV1_mysql | 2017-05-10T23:05:21.947247Z 0 [Note] Event Scheduler: Purging the queue. 0 events
ENV1_mysql | 2017-05-10T23:05:21.947988Z 0 [Note] Binlog end
ENV1_mysql | 2017-05-10T23:05:21.962498Z 0 [Note] Shutting down plugin 'ngram'
ENV1_mysql | 2017-05-10T23:05:21.962585Z 0 [Note] Shutting down plugin 'BLACKHOLE'
ENV1_mysql | 2017-05-10T23:05:21.962606Z 0 [Note] Shutting down plugin 'partition'
ENV1_mysql | 2017-05-10T23:05:21.962623Z 0 [Note] Shutting down plugin 'ARCHIVE'
ENV1_mysql | 2017-05-10T23:05:21.962639Z 0 [Note] Shutting down plugin 'INNODB_SYS_VIRTUAL'
ENV1_mysql | 2017-05-10T23:05:21.962668Z 0 [Note] Shutting down plugin 'INNODB_SYS_DATAFILES'
ENV1_mysql | 2017-05-10T23:05:21.962682Z 0 [Note] Shutting down plugin 'INNODB_SYS_TABLESPACES'
ENV1_mysql | 2017-05-10T23:05:21.962710Z 0 [Note] Shutting down plugin 'INNODB_SYS_FOREIGN_COLS'
ENV1_mysql | 2017-05-10T23:05:21.962733Z 0 [Note] Shutting down plugin 'INNODB_SYS_FOREIGN'
ENV1_mysql | 2017-05-10T23:05:21.962747Z 0 [Note] Shutting down plugin 'INNODB_SYS_FIELDS'
ENV1_mysql | 2017-05-10T23:05:21.962778Z 0 [Note] Shutting down plugin 'INNODB_SYS_COLUMNS'
ENV1_mysql | 2017-05-10T23:05:21.962791Z 0 [Note] Shutting down plugin 'INNODB_SYS_INDEXES'
ENV1_mysql | 2017-05-10T23:05:21.962804Z 0 [Note] Shutting down plugin 'INNODB_SYS_TABLESTATS'
ENV1_mysql | 2017-05-10T23:05:21.962822Z 0 [Note] Shutting down plugin 'INNODB_SYS_TABLES'
ENV1_mysql | 2017-05-10T23:05:21.962835Z 0 [Note] Shutting down plugin 'INNODB_FT_INDEX_TABLE'
ENV1_mysql | 2017-05-10T23:05:21.962875Z 0 [Note] Shutting down plugin 'INNODB_FT_INDEX_CACHE'
ENV1_mysql | 2017-05-10T23:05:21.962886Z 0 [Note] Shutting down plugin 'INNODB_FT_CONFIG'
ENV1_mysql | 2017-05-10T23:05:21.962896Z 0 [Note] Shutting down plugin 'INNODB_FT_BEING_DELETED'
ENV1_mysql | 2017-05-10T23:05:21.962904Z 0 [Note] Shutting down plugin 'INNODB_FT_DELETED'
ENV1_mysql | 2017-05-10T23:05:21.962914Z 0 [Note] Shutting down plugin 'INNODB_FT_DEFAULT_STOPWORD'
ENV1_mysql | 2017-05-10T23:05:21.962924Z 0 [Note] Shutting down plugin 'INNODB_METRICS'
ENV1_mysql | 2017-05-10T23:05:21.962937Z 0 [Note] Shutting down plugin 'INNODB_TEMP_TABLE_INFO'
ENV1_mysql | 2017-05-10T23:05:21.962985Z 0 [Note] Shutting down plugin 'INNODB_BUFFER_POOL_STATS'
ENV1_mysql | 2017-05-10T23:05:21.962997Z 0 [Note] Shutting down plugin 'INNODB_BUFFER_PAGE_LRU'
ENV1_mysql | 2017-05-10T23:05:21.963007Z 0 [Note] Shutting down plugin 'INNODB_BUFFER_PAGE'
ENV1_mysql | 2017-05-10T23:05:21.963016Z 0 [Note] Shutting down plugin 'INNODB_CMP_PER_INDEX_RESET'
ENV1_mysql | 2017-05-10T23:05:21.963045Z 0 [Note] Shutting down plugin 'INNODB_CMP_PER_INDEX'
ENV1_mysql | 2017-05-10T23:05:21.963054Z 0 [Note] Shutting down plugin 'INNODB_CMPMEM_RESET'
ENV1_mysql | 2017-05-10T23:05:21.963063Z 0 [Note] Shutting down plugin 'INNODB_CMPMEM'
ENV1_mysql | 2017-05-10T23:05:21.963071Z 0 [Note] Shutting down plugin 'INNODB_CMP_RESET'
ENV1_mysql | 2017-05-10T23:05:21.963081Z 0 [Note] Shutting down plugin 'INNODB_CMP'
ENV1_mysql | 2017-05-10T23:05:21.963094Z 0 [Note] Shutting down plugin 'INNODB_LOCK_WAITS'
ENV1_mysql | 2017-05-10T23:05:21.963128Z 0 [Note] Shutting down plugin 'INNODB_LOCKS'
ENV1_mysql | 2017-05-10T23:05:21.963149Z 0 [Note] Shutting down plugin 'INNODB_TRX'
ENV1_mysql | 2017-05-10T23:05:21.963163Z 0 [Note] Shutting down plugin 'InnoDB'
ENV1_mysql | 2017-05-10T23:05:21.963427Z 0 [Note] InnoDB: FTS optimize thread exiting.
ENV1_mysql | 2017-05-10T23:05:21.963841Z 0 [Note] InnoDB: Starting shutdown...
ENV1_mysql | 2017-05-10T23:05:22.066175Z 0 [Note] InnoDB: Dumping buffer pool(s) to /var/lib/mysql/ib_buffer_pool
ENV1_mysql | 2017-05-10T23:05:22.070328Z 0 [Note] InnoDB: Buffer pool(s) dump completed at 170510 23:05:22
ENV1_job | 2017-05-10T23:05:23.069Z 1 TID-qhjgc ERROR: heartbeat: getaddrinfo: Name or service not known
ENV1_mysql | 2017-05-10T23:05:23.495794Z 0 [Note] InnoDB: Shutdown completed; log sequence number 209478342
ENV1_mysql | 2017-05-10T23:05:23.497199Z 0 [Note] InnoDB: Removed temporary tablespace data file: "ibtmp1"
ENV1_mysql | 2017-05-10T23:05:23.497241Z 0 [Note] Shutting down plugin 'MRG_MYISAM'
ENV1_mysql | 2017-05-10T23:05:23.497249Z 0 [Note] Shutting down plugin 'MyISAM'
ENV1_mysql | 2017-05-10T23:05:23.497259Z 0 [Note] Shutting down plugin 'CSV'
ENV1_mysql | 2017-05-10T23:05:23.497263Z 0 [Note] Shutting down plugin 'MEMORY'
ENV1_mysql | 2017-05-10T23:05:23.497268Z 0 [Note] Shutting down plugin 'PERFORMANCE_SCHEMA'
ENV1_mysql | 2017-05-10T23:05:23.497629Z 0 [Note] Shutting down plugin 'sha256_password'
ENV1_mysql | 2017-05-10T23:05:23.497651Z 0 [Note] Shutting down plugin 'mysql_native_password'
ENV1_mysql | 2017-05-10T23:05:23.497987Z 0 [Note] Shutting down plugin 'binlog'
ENV1_mysql | 2017-05-10T23:05:23.501084Z 0 [Note] mysqld: Shutdown complete
ENV1_mysql |
ENV1_mysql exited with code 0
ENV1_job | 2017-05-10T23:05:25.488Z 1 TID-5ccjc INFO: Shutting down
ENV1_job | 2017-05-10T23:05:25.488Z 1 TID-5ccjc INFO: Terminating quiet workers
ENV1_job | 2017-05-10T23:05:25.488Z 1 TID-qhjas INFO: Scheduler exiting...
ENV1_job | 2017-05-10T23:05:25.989Z 1 TID-5ccjc INFO: Pausing to allow workers to finish...
ENV2_sql | 2017-05-10T23:05:26.401023Z 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
ENV2_sql | 2017-05-10T23:05:26.407562Z 0 [Note] mysqld (mysqld 5.7.18) starting as process 1 ...
ENV2_sql | 2017-05-10T23:05:26.413174Z 0 [Warning] Setting lower_case_table_names=2 because file system for /var/lib/mysql/ is case insensitive
ENV2_sql | 2017-05-10T23:05:26.417101Z 0 [Note] InnoDB: PUNCH HOLE support available
ENV2_sql | 2017-05-10T23:05:26.417219Z 0 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
ENV2_sql | 2017-05-10T23:05:26.417228Z 0 [Note] InnoDB: Uses event mutexes
ENV2_sql | 2017-05-10T23:05:26.417615Z 0 [Note] InnoDB: GCC builtin __atomic_thread_fence() is used for memory barrier
ENV2_sql | 2017-05-10T23:05:26.417853Z 0 [Note] InnoDB: Compressed tables use zlib 1.2.3
ENV2_sql | 2017-05-10T23:05:26.417876Z 0 [Note] InnoDB: Using Linux native AIO
ENV2_sql | 2017-05-10T23:05:26.419199Z 0 [Note] InnoDB: Number of pools: 1
ENV2_sql | 2017-05-10T23:05:26.420183Z 0 [Note] InnoDB: Using CPU crc32 instructions
ENV2_sql | 2017-05-10T23:05:26.424034Z 0 [Note] InnoDB: Initializing buffer pool, total size = 128M, instances = 1, chunk size = 128M
ENV2_sql | 2017-05-10T23:05:26.439491Z 0 [Note] InnoDB: Completed initialization of buffer pool
ENV2_sql | 2017-05-10T23:05:26.441642Z 0 [Note] InnoDB: If the mysqld execution user is authorized, page cleaner thread priority can be changed. See the man page of setpriority().
ENV2_sql | 2017-05-10T23:05:26.506532Z 0 [Note] InnoDB: Highest supported file format is Barracuda.
ENV2_sql | 2017-05-10T23:05:26.849378Z 0 [Note] InnoDB: Creating shared tablespace for temporary tables
ENV2_sql | 2017-05-10T23:05:26.852156Z 0 [Note] InnoDB: Setting file './ibtmp1' size to 12 MB. Physically writing the file full; Please wait ...
ENV2_sql | 2017-05-10T23:05:26.941263Z 0 [Note] InnoDB: File './ibtmp1' size is now 12 MB.
ENV2_sql | 2017-05-10T23:05:26.949972Z 0 [Note] InnoDB: 96 redo rollback segment(s) found. 96 redo rollback segment(s) are active.
ENV2_sql | 2017-05-10T23:05:26.950017Z 0 [Note] InnoDB: 32 non-redo rollback segment(s) are active.
ENV2_sql | 2017-05-10T23:05:26.950423Z 0 [Note] InnoDB: Waiting for purge to start
ENV2_sql | 2017-05-10T23:05:27.001600Z 0 [Note] InnoDB: 5.7.18 started; log sequence number 33405165
ENV2_sql | 2017-05-10T23:05:27.001924Z 0 [Note] Plugin 'FEDERATED' is disabled.
ENV2_sql | 2017-05-10T23:05:27.004603Z 0 [Note] InnoDB: Loading buffer pool(s) from /var/lib/mysql/ib_buffer_pool
ENV2_sql | 2017-05-10T23:05:27.133456Z 0 [Note] Found ca.pem, server-cert.pem and server-key.pem in data directory. Trying to enable SSL support using them.
ENV2_sql | 2017-05-10T23:05:27.165752Z 0 [Warning] CA certificate ca.pem is self signed.
ENV2_sql | 2017-05-10T23:05:27.171471Z 0 [Note] Server hostname (bind-address): '*'; port: 3306
ENV2_sql | 2017-05-10T23:05:27.171547Z 0 [Note] IPv6 is available.
ENV2_sql | 2017-05-10T23:05:27.171563Z 0 [Note]   - '::' resolves to '::';
ENV2_sql | 2017-05-10T23:05:27.171613Z 0 [Note] Server socket created on IP: '::'.
ENV2_sql | 2017-05-10T23:05:27.231101Z 0 [Note] InnoDB: Buffer pool(s) load completed at 170510 23:05:27
ENV2_sql | 2017-05-10T23:05:27.299944Z 0 [Warning] 'user' entry 'root@localhost' ignored in --skip-name-resolve mode.
ENV2_sql | 2017-05-10T23:05:27.300034Z 0 [Warning] 'user' entry 'mysql.sys@localhost' ignored in --skip-name-resolve mode.
ENV2_sql | 2017-05-10T23:05:27.304521Z 0 [Warning] 'db' entry 'sys mysql.sys@localhost' ignored in --skip-name-resolve mode.
ENV2_sql | 2017-05-10T23:05:27.305993Z 0 [Warning] 'proxies_priv' entry '@ root@localhost' ignored in --skip-name-resolve mode.
ENV2_sql | 2017-05-10T23:05:27.420660Z 0 [Warning] 'tables_priv' entry 'sys_config mysql.sys@localhost' ignored in --skip-name-resolve mode.
ENV1_job | 2017-05-10T23:05:27.494Z 1 TID-5ccjc INFO: Bye!
ENV2_sql | 2017-05-10T23:05:27.788719Z 0 [Note] Event Scheduler: Loaded 0 events
ENV2_sql | 2017-05-10T23:05:27.790225Z 0 [Note] mysqld: ready for connections.
ENV2_sql | Version: '5.7.18'  socket: '/var/run/mysqld/mysqld.sock'  port: 3306  MySQL Community Server (GPL)
ENV2_sql | 2017-05-10T23:05:27.790320Z 0 [Note] Executing 'SELECT * FROM INFORMATION_SCHEMA.TABLES;' to get a list of tables using the deprecated partition engine. You may use the startup option '--disable-partition-engine-check' to skip this check.
ENV2_sql | 2017-05-10T23:05:27.790330Z 0 [Note] Beginning of list of non-natively partitioned tables
ENV1_job exited with code 0
ENV2_sql | 2017-05-10T23:05:28.588345Z 0 [Note] End of list of non-natively partitioned tables
ENV2_job | 2017-05-10T23:05:32.681Z 1 TID-afb0o INFO: Running in ruby 2.4.1p111 (2017-03-22 revision 58053) [x86_64-linux]
ENV2_job | 2017-05-10T23:05:32.681Z 1 TID-afb0o INFO: See LICENSE and the LGPL-3.0 for licensing details.
ENV2_job | 2017-05-10T23:05:32.681Z 1 TID-afb0o INFO: Upgrade to Sidekiq Pro for more features and support: http://sidekiq.org
ENV2_job | 2017-05-10T23:05:32.682Z 1 TID-afb0o INFO: Booting Sidekiq 4.2.10 with redis options {:url=>"redis://redis:6379"}
ENV2_job | 2017-05-10T23:05:32.690Z 1 TID-afb0o INFO: Starting processing, hit Ctrl-C to stop
ENV2_web | The Gemfile's dependencies are satisfied
ENV2_web | => Booting Puma
ENV2_web | => Rails 5.1.0.rc2 application starting in development on http://0.0.0.0:3000
ENV2_web | => Run `rails server -h` for more startup options
ENV2_web | Puma starting in single mode...
ENV2_web | * Version 3.8.2 (ruby 2.4.1-p111), codename: Sassy Salamander
ENV2_web | * Min threads: 5, max threads: 5
ENV2_web | * Environment: development
ENV2_web | * Listening on tcp://0.0.0.0:3000
ENV2_web | Use Ctrl-C to stop
An HTTP request took too long to complete. Retry with --verbose to obtain debug information.
If you encounter this issue regularly because of slow network conditions, consider setting COMPOSE_HTTP_TIMEOUT to a higher value (current value: 60).
EXCEPTION: #<Docker::Compose::Error: 'up' failed with status 'pid 77888 exit 1': Attaching to ENV1_mysql, ENV1_redis, ENV1_web, ENV1_job>
MESSAGE: 'up' failed with status 'pid 77888 exit 1': Attaching to ENV1_mysql, ENV1_redis, ENV1_web, ENV1_job

一切都关闭了。

ENV1配置:

多克尔-撰写

version: '2'
services:
  db:
    container_name: env1_mysql
    image: mysql
    volumes:
      - ./data/sql:/var/lib/mysql
    ports:
      - "3306:3306"
    environment:
      MYSQL_DATABASE: dev
      MYSQL_USER: rails
      MYSQL_PASSWORD: rails
      MYSQL_ROOT_PASSWORD: root

  redis:
    container_name: env1_redis
    image: redis
    ports:
      - "6379:6379"
    volumes:
      - ./data/redis:/data

  web:
    container_name: env1_web
    build: .
    command: sh scripts/start-dev.sh
    volumes:
      - /etc/localtime:/etc/localtime:ro
      - env1-web-sync:/app:nocopy
      - env1-bundle-sync:/bundle:nocopy
      # - env1-static-sync:/static:ro
    ports:
      - "3030:3030"
    environment:
      REDIS_URL: redis://redis:6379
      DB_USER: rails
      DB_PASSWORD: rails
    links:
      - db
      - redis
    tty: true
    stdin_open: true

  job:
    container_name: env1_job
    build: .
    command: bundle exec sidekiq -C config/sidekiq.yml
    volumes:
      - env1-web-sync:/app:nocopy
      - env1-bundle-sync:/bundle:nocopy
    environment:
      REDIS_URL: redis://redis:6379
    links:
      - db
      - redis

volumes:
  env1-web-sync:
    external: true
  env1-bundle-sync:
    external: true

多克尔同步

version: '2'
options:
  compose-file-path: 'docker-compose.yml'
syncs:
  env1-web-sync:
    src: './ENV1'
    sync_strategy: 'unison'
    sync_excludes: [ '.git', '.idea', 'tmp/*' ]
  env1-bundle-sync:
    src: './bundle'
    sync_strategy: 'unison'

ENV2配置:

多克尔-撰写

version: '2'
services:
  db:
    container_name: env2_sql
    image: mysql
    volumes:
      - ./data/sql:/var/lib/mysql
    ports:
      - "3307:3306"
    environment:
      MYSQL_DATABASE: dev
      MYSQL_USER: rails
      MYSQL_PASSWORD: rails
      MYSQL_ROOT_PASSWORD: root

  redis:
    container_name: env2_redis
    image: redis
    ports:
      - "6380:6379"
    volumes:
      - ./data/redis:/data

  web:
    container_name: env2_web
    build: .
    command: sh scripts/start-dev.sh
    volumes:
      - env2-web-sync:/app:nocopy
      - env2-bundle-sync:/bundle:nocopy
      - env2-static-sync:/static:nocopy
    ports:
      - "3000:3000"
    environment:
      REDIS_URL: redis://redis:6379
      MYSQL_USER: rails
      MYSQL_PASSWORD: rails
    links:
      - db
      - redis
    tty: true
    stdin_open: true

  java:
    container_name: env2_java
    image: java:openjdk-8
    volumes:
      - env2-java-sync:/app:nocopy
    links:
      - db
    tty: true
    stdin_open: true

  job:
    container_name: env2_job
    build: .
    command: bundle exec sidekiq -C config/sidekiq.yml
    volumes:
      - env2-web-sync:/app:nocopy
      - env2-bundle-sync:/bundle:nocopy
    environment:
      REDIS_URL: redis://redis:6379
    links:
      - db
      - redis


volumes:
  env2-web-sync:
    external: true
  env2-bundle-sync:
    external: true
  env2-static-sync:
    external: true
  env2-java-sync:
    external: true

多克尔同步:

version: "2"
options:
  compose-file-path: 'docker-compose.yml'
syncs:
  env2-web-sync:
    src: './ENV2'
    sync_strategy: 'unison'
    sync_excludes: [ '.git', '.idea', 'tmp/*' ]
  env2-bundle-sync:
    src: './bundle'
    sync_strategy: 'unison'
  env2-static-sync:
    src: '../static'
    sync_strategy: 'unison'
  env2-java-sync:
    src: './java'
    sync_strategy: 'unison'

1 个答案:

答案 0 :(得分:0)

请升级到0.4.5,这应该可以解决您的问题。重新考虑native_osx - 它通常比旧的统一方式好很多,特别是在CPU使用方面。

以任何方式,检查您的sync_excludes语法,因为&#34; Name&#34;默认使用,&#39; tmp / *&#39;是错的。使用tmp或使用 https://github.com/EugenMayer/docker-sync/blob/master/example/docker-sync.yml#L75

sync_excludes_type: 'none'
sync_excludes: [ 'Name .git', 'Path .idea', 'Path tmp' ]

0.4.x很安静,我理解你的挫败感,请参阅https://github.com/EugenMayer/docker-sync/issues/370了解背景故事

相关问题