-- Leo's gemini proxy

-- Connecting to g.codelearn.me:1965...

-- Connected

-- Sending request

-- Meta line: 20 text/gemini

Setup TeamCity on Mac to work with Docker


For one of our project we decided to use TeamCity on our Mac Mini (which is under table in the same room where we are).


It was interesting experience with some pitfalls and I would like to share how we did it. Want to mention that installation of TeamCity is not subject of this article and I’m sure you can find a lot of posts about it in the internet.


One more important thing. TeamCity on our MacMini was installed to **/Library/TeamCity** folder. Docker machine shares only home directory (/Users) but some of our docker containers requires **/Library/TeamCity/hash/our project name/src** directory to be shared.


Project structure


├── docker
│   ├── application
├── scripts
└── src
    ├── app
    ├── bootstrap
    ├── config
    ├── database
    ├── public
    ├── resources
    ├── storage
    ├── tests
    └── vendor

application:
    build: ./application
    volumes:
        - ../src:/var/www/application

So, because our TeamCity loads the project inside **/Library/TeamCity** folder which is not shared between host and docker-machine we have the issue. From docker container's standpoint the folder looks empty.


Open VirtualBox Manager.

Choose your docker-machine (default - in my case)

Press Settings.

Go to Shared Folders tab and press Add new shared folder (folder with + icon at the right hand side)


Add **Library** folder to the folders list.


That’s not enough. All these steps are only shares the folder to the VM but it is not mounted yet.


Login inside docker-machine via ssh (**docker-machine ssh**) and mount /Library folder like that:


mkdir /Library && mount -t vboxsf Library /Library

Since docker-machine is heir of boot2docker we can use special boot2docker feature that allow us to run the script right after machine is started.


Login inside of docker-machine (docker-machine ssh)

go to - /var/lib/boot2docker/

create bootlocal.sh file

open it and enter the next few lines


#!/bin/sh

mkdir /Library
mount -t vboxsf Library /Library

-- Response ended

-- Page fetched on Sun May 12 10:23:17 2024