elkarbackup不会连接到mysql

时间:2018-12-22 16:13:12

标签: mysql docker

我正在尝试使Elkarbackup的容器连接到mysql容器,但是所有日志都显示为:"MySQL is unavailable - sleeping,"

两个容器都在同一网络上(默认)。 还有其他人遇到类似的问题吗?

似乎我现在已经尝试了几乎所有东西。阅读docs / man-pages,它“应该”工作...

服务器:Ubuntu 18.04 Docker版本18.09.0,内部版本4d60db4 docker-compose版本1.23.2,内部版本1110ad01

这是我的docker-compose.yml文件:

 ---
version: "3"
services:
  database:
  image: "mysql:5.7.22"
  container_name: "mysql"
  hostname: mysql
  restart: always
  networks:
    - default
  volumes:
    - /etc/localtime:/etc/localtime:ro
    - ${USERDIR}/docker/mysql:/config
    - ${USERDIR}/docker/mysql:/var/lib/mysql
  environment:
    - MYSQL_ROOT_PASSWORD=r00t-p@ssw0rd
    - PUID=${PUID}
    - PGID=${PGID}
    - TZ=${TZ}
  elkarbackup:
    image: "elkarbackup/elkarbackup:latest"
    container_name: elkarbackup
    hostname: elkarbackup
    restart: always
    links:
      - database
    depends_on:
      - database
    environment:
      EB_DATABASE_PASSWORD: "r00t_p@ssw0rd"
      EB_CRON: "enabled"
    volumes:
      - /etc/localtime:/etc/localtime:ro
      - ${USERDIR}/docker/elkarbackup/backups:/backups
      - ${USERDIR}/docker/elkarbackup/uploads:/uploads
      - ${USERDIR}/docker/elkarbackup/sshkeys:/.ssh
    ports:
      - "8000:80"
      - "8443:443"
    networks:
      - default

0 个答案:

没有答案