Docker Install on Mac (Sierra)

Hi Everyone,

I am installing metasfresh for the first time using Docker on a Mac. I am receiving an error after the “docker-compose up -d” command. The error states that /etc/timezone is not shared. On a mac, there is no /etc/timezone file (unlike ubuntu). Can someone share insight how to fix? Thanks!!

FYI - I am new to docker.
FYI - As a result of the below errors, “docker ps” shows nothing.

Docker Version:
Version 17.06.0-ce-mac19 (18663)
Channel: stable
c98c1c25e0

Thank you for your time and consideration!

Here are the error details:
ERROR: for metasfreshdocker_db_1 Cannot start service db: Mounts denied:
The path /etc/timezone
is not shared from OS X and is not known to Docker.
You can configure shared paths from Docker -> Preferences… -> File Sharing.
See https://docs.docker.com/docker-for-mac/osxfs/#namespaces for more info.
.
Starting metasfreshdocker_search_1 … error
ERROR: for metasfreshdocker_search_1 Cannot start service search: Mounts denied:
The path /etc/timezone
is not shared from OS X and is not known to Docker.
You can configure shared paths from Docker -> Preferences… -> File Sharing.
See https://docs.docker.com/docker-for-mac/osxfs/#namespaces for more info.
.

ERROR: for search  Cannot start service search: Mounts denied: 
The path /etc/timezone
is not shared from OS X and is not known to Docker.
You can configure shared paths from Docker -> Preferences... -> File Sharing.
See https://docs.docker.com/docker-for-mac/osxfs/#namespaces for more info.

Hi Chuck,

you can remove the volume for /etc/timezone from the docker-compose.yml to fix that.
Its there for Linux servers. I think we need to prepare a special Mac Docker-compose.yml.
@julian.bischof What do you think?

Kind regards,
Norbert

Hey @Chuck_Boecking ,

as Norbert suggested you should be able to create a running metasfresh-docker stack without using the mount “timezone”.

You just need to open the metasfresh-docker/docker-compose.yml file and remove the lines containing - /etc/timezone:/etc/timezone:ro. Using a default metasfresh-docker stack, there should be 5 of these lines throughout the file - for each container-definition one.

Keep in mind to completely remove the line so there’s no empty line, else docker-compose might complain about an invalid yml file.

After modifiying, the entries should look similar to this:

db:
  build: db
  restart: always
  volumes:
    - ./volumes/db/data:/var/lib/postgresql/data
    - ./volumes/db/log:/var/log/postgresql
    - /etc/localtime:/etc/localtime:ro
  environment:
...

However, please also keep in mind to check if date-settings in metasfresh are correct after you ran the modified docker-compose file.
You can check the date by using the command:
docker exec -it metasfreshdocker_app_1 date
The output of that command should be the same as your local time.

We did not test the metasfresh-docker stack on iOS so please let us know if anything works out for you :slight_smile:

Kindly,
Julian

Hi all,
Same thing happens on fresh install of CentOS7 (updated to latest). Workaround works - comment out timezone lines from docker-compose.yml.

Info about this system:

docker --version
Docker version 17.06.1-ce, build 874a737

uname -a
Linux metafresh 3.10.0-514.26.2.el7.x86_64 #1 SMP Tue Jul 4 15:04:05 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux

cat /etc/redhat-release 
CentOS Linux release 7.3.1611 (Core) 

docker-compose --version
docker-compose version 1.15.0, build e12f3b9

LC_ALL=C date
Wed Aug 30 13:59:18 CEST 2017

docker exec -it metasfreshdocker_app_1 date
Wed Aug 30 13:59:22 CEST 2017

tree /etc/timezone/
/etc/timezone/

0 directories, 0 files

docker-compose up -d
Starting metasfreshdocker_db_1 ... 
Starting metasfreshdocker_search_1 ... 
Starting metasfreshdocker_search_1
Starting metasfreshdocker_db_1 ... error

ERROR: for metasfreshdocker_db_1  Cannot start service db: oci runtime error: container_linux.go:262: starting container process caused "process_linux.go:339: container init caused \"rootfs_linux.go:57: mounting \\\"/etc/timezone\\\" to rootfs \\\"/var/lib/docker/overlay/cdabb2704d81bd0148958aebf7c60105c277638a50f9b6ee35aa386a58e84915/merged\\\" at \\\"/var/lib/docker/overlay/cdabb2704d81bd0148958aebf7c60105c277638a50f9b6ee35aa386a58e84915/merged/etc/timezone\\\" caused \\\"not a directory\\\"\""
: Are you trying to mount a directory onto a file (or vice-versa)? Check if the Starting metasfreshdocker_search_1 ... error

Best Regards

Hi @pejas

Thank you for your feedback to the suggested solution.
The metasfresh-docker installation tutorial is built around a Debian based OS (Ubuntu to be precise, since it’s one of the most common linux distros).

I think we can adapt our documentation to reflect your tests with a redhat based distribution, so thank you for your feedback :slight_smile:

Julian