colima: Colima v0.2.2 trying to run a simple java springboot application - fails with readonly filesystem

I’m running colima v0.2.2 - (thanks for the great s/w btw)

Today I started on a java project, and I was trying to run the springboot application (default starter kit) from a docker container - but, I keep getting this error:

 * What went wrong:
 Gradle could not start your build.
 > Could not create service of type BuildModelController using BuildScopeServicesProvider.createBuildModelController().
    > Could not create service of type FileHasher using BuildSessionServices.createFileHasher().
       > java.io.IOException: Read-only file system

I am starting colima with colima start as normal.

The Dockerfile is quite simple (it simply mounts the current directory to /app and tries to run gradlew):

FROM docker.io/library/amazoncorretto:11 AS build

VOLUME ["/app"]

WORKDIR /app

CMD ["./gradlew", "bootRun"]

Could you please help?

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Reactions: 1
  • Comments: 19 (4 by maintainers)

Most upvoted comments

ok - I have come back to testing this with the latest HEAD version installed via brew install --head colima as suggested above. I am on macos Monterey 12.1 I started colima with colima start --mount $HOME:w

I am using a minimalistic docker-compose file:

version: '3'
services:
  db:
    image: "postgres:13.4"
    container_name: api-db
    volumes:
      - ./postgres-data:/var/lib/postgresql/data
    environment:
      - POSTGRES_USER=apiDbUser
      - POSTGRES_PASSWORD=apiDbPassword
      - POSTGRES_DB=apiDb
    ports:
      - "5433:5432"

The error that I get is:

Attaching to api-db
api-db  | chown: changing ownership of '/var/lib/postgresql/data': Permission denied
api-db exited with code 1

I have also tried it with mkdir postgres-data; chmod 777 postgres-data; docker-compose up --build --remove-orphans - same issue

The chown is something you have customized somewhere or is the base postgresql docker image?

Its not something that I have created. I have shown the complete docker-compose.yml in my comment. This seems to be coming from the postgresql docker image.

Did you fixed this issue?

Version 0.3.0 is actually going to default to writeable volumes, so most users would not need to modify the volumes.

@vraravam For now, I would recommend specifying volume mounts only at initial startup. I have encountered some inconsistencies with Lima when modifying mounts of an existing VM.

I will dig into this a bit better to find the root cause.