Just to make sure I understand, you’re trying to copy your my.cnf file from your main container (circleci/php) to your mysql container?
Assuming that’s the case, then you’re probably going to have a problem because at the point that you’re spinning up your containers, you haven’t checked your code out yet. Once you reach that step, you’ll no longer be able to use the docker daemon thread to move files between containers. I had a similar problem… I ended up using a machine build and then starting up my docker containers myself. I could then move files freely between them with the “docker cp” command. Here’s an example of what your configuration could look like:
name: Start containers
command: docker run --name mysqlcontainer -e MYSQL_ROOT_PASSWORD=root -e MYSQL_DATABASE=test -d mysql:5.7
name: Move config file
command: docker cp /etc/mysql/my.cnf mysqlcontainer:/etc/mysql/my.cnf