I have an issue whereby my local Docker builds run fine, but on circle I get an error. The dockerfile looks like this:
FROM node:5 WORKDIR opt/app ADD package.json . RUN npm install ADD . . EXPOSE 8080 CMD ["npm", "start"]
The app in the container is a bog standard Hapi.js server - essentialy nothing more than the sample app, nothing special. Locally I build and deploy the container with no issues at all, using a makefile:
deploy: # Build the docker image, using the 'latest' tag. docker build -t myproject/app:latest . # Login to the Docker Hub and push the image. docker login -e $(DOCKER_EMAIL) -u $(DOCKER_USERNAME) -p $(DOCKER_PASSWORD) docker push mproject/app:latest
As I would expect, as this is all standard stuff. However - running the
make deploy command on CircleCI in my deployment step results in:
Digest: sha256:9da79fcba95ec76805a18b387aa2ff81927d2ebe0cd6c897cfdc2e80b8a91432 Status: Downloaded newer image for node:5 ---> 319251e19588 Step 2 : WORKDIR opt/app ---> Running in 4f5f8bd1793c ---> 3c2e01e38161 Error removing intermediate container 4f5f8bd1793c: rmdriverfs: Driver btrfs failed to remove root filesystem 4f5f8bd1793c9c5cf1f7aef5391471b6a409e6a2c11e61cbf1ebdb9dc3de363e: Failed to destroy btrfs snapshot /var/lib/docker/btrfs/subvolumes for 4f5f8bd1793c9c5cf1f7aef5391471b6a409e6a2c11e61cbf1ebdb9dc3de363e: operation not permitted Step 3 : ADD package.json . ---> 633e287145d2 Error removing intermediate container 4f5f8bd1793c: nosuchcontainer: no such id: 4f5f8bd1793c9c5cf1f7aef5391471b6a409e6a2c11e61cbf1ebdb9dc3de363e Step 4 : RUN npm install ---> Running in 5fe2afdce5b0 Cannot mkdir: /opt/app is not a directory make: *** [deploy] Error 1 make deploy returned exit code 2 Action failed: make deploy
WORKDIR (as the CicleCI build seems to struggle with it) fixes nothing (but actually breaks my project as it means my code runs in
\ and attempts to watch system files which are adjacent).
Can anyone help? This is hugely limiting for me as I cannot deploy my containers! In case it makes a difference, here’s my circle.yml, I’ve tried ‘vanilla’ docker and a few of the versions available for CicleCI on S3:
machine: node: version: 5 pre: - sudo curl -L -o /usr/bin/docker 'https://s3-external-1.amazonaws.com/circle-downloads/docker-1.9.1-circleci' - sudo chmod 0755 /usr/bin/docker services: - docker deployment: master: branch: master commands: - make deploy
Thanks in advance!!!