Docker images and compose on external SSD for WordPress not working

Hi. I’m attempting to have Docker run WordPress installations on an external drive. It’s a 1TB Samsung T5 SSD formatted to exFAT. I would like to be able to use this across Windows and Mac OS

I changed the disk image location to the external drive which worked fine. The problems come when running docker-compose up on the external drive. It’s extremely slow to build the images. I had to extend the timeout period as it kept throwing errors. It now gets to a point where WordPress can’t connect to MySQL, returning the error ‘Connection refused’.

I left it trying to connect for about an hour at one point and came back to see the WordPress installation screen. So maybe it’s just a speed issue, but I’m not sure why this might be the case.

Everything works fine when I have the image on the main drive of the Mac and run docker-compose, it’s only when it’s moved to the external SSD.

Here is my Docker-compose.yml file:

version: "3.3"

services:
  # Database
  db:
    image: mysql:5.7
    volumes:
      - db_data:/var/lib/mysql
    restart: always
    environment:
      MYSQL_DATABASE: wordpress
      MYSQL_USER: wordpress
      MYSQL_PASSWORD: wordpress
      MYSQL_ROOT_PASSWORD: password
    networks:
      - wpsite
  # phpmyadmin
  phpmyadmin:
    depends_on:
      - db
    image: phpmyadmin/phpmyadmin
    restart: always
    ports:
      - "8181:80"
    environment:
      PMA_HOST: db
      MYSQL_ROOT_PASSWORD: password
    networks:
      - wpsite
  # Mailcatcher
  mailcatcher:
    image: schickling/mailcatcher
    ports:
      - "1025:1025"
      - "1080:1080"
    environment:
      MAILCATCHER_PORT: 1025
  # Wordpress
  wordpress:
    depends_on:
      - db
    image: wordpress:latest
    ports:
      - "8000:80"
    restart: always
    volumes: ["./:/var/www/html"]
    environment:
      WORDPRESS_DB_HOST: db
      WORDPRESS_DB_NAME: wordpress
      WORDPRESS_DB_USER: wordpress
      WORDPRESS_DB_PASSWORD: wordpress
    networks:
      - wpsite
networks:
  wpsite:
volumes:
  db_data:

Any help would be appreciated.

Thanks,

Ollie

Hey Ollie, I ran into this issue as well, and after a bunch of troubleshooting, eventually found that if I formatted the drive to use APFS (apple’s new file system format), then I was able to successfully run Docker with the disk image located on the external SSD. When I initially tried doing this, Docker was basically unusable it was so slow. Many services running within the docker containers just kept failing intermittently. Also, restarting docker took FOREVER.

After formatting the drive using Disk Utility following the instructions here: https://kb.sandisk.com/app/answers/detail/a_id/20542/~/converting-external-drive-to-apple-file-system-(apfs)-format

I simply used Docker for Mac desktop tool to configure the new disk image location to point to the external drive, and all was well afterwards.

Please note that during the process I reset docker to its factory defaults. And in my case I had been using Docker for a long time, which means Docker was storing the main VM in a .qcow2 format instead of the newer .raw format. When I did the factory reset using the latest version of Docker for Mac, I noticed it switched to using this new .raw format. I mention this as it could also be the reason things started working correctly, and may have nothing to do with the external drive file system format.

Lastly, note I’m using a Sabrent Rocket XTRM-Q SSD on a Thunderbolt 3 connection. Here’s the exact drive: https://www.amazon.com/dp/B08BZ2FXTF/ref=cm_sw_r_tw_dp_SGq-FbV6Y0TCV?_encoding=UTF8&psc=1

Hope this helps other people, as I didn’t find anything else on the internet about this.