I created several Docker images with mock data that I’m trying to run inside CircleCI (2.0), so my tests have a database to connect to. I ended up going down the route of a multi-image setup:
build: docker: - image: circleci/node:7.10 - image: private_repo/postgres:latest
Where the Postgres Docker image is a custom image (postgres:9.6.1-alpine base) with pre-loaded data (multi-stage Docker image where data is restored, and the resulting data directory is copied to a fresh Postgres image).
My issue is that while the custom Postgres image runs fine on my own device, it appears to have issues when being run inside CircleCI as a secondary image. I see a lot of lines like this output:
could not remove cache file "global/pg_internal.init": Permission denied
Again, these issues do not occur when I run this image elsewhere. Any ideas?
Extra: this is how I generate the custom Postgres image with pre-loaded data:
FROM postgres:9.6.1-alpine AS donor ADD VERSION . ENV PGDATA=/pgdata RUN mkdir /tmp/insert-data COPY "data-fetch/data/*" "/tmp/insert-data/" COPY "image_extend/*" "/docker-entrypoint-initdb.d/" RUN chmod 755 /docker-entrypoint-initdb.d/*.sh RUN /docker-entrypoint.sh --help #all the data is loaded to this instance FROM postgres:9.6.1-alpine ENV PGDATA=/pgdata COPY --from=donor /pgdata /pgdata