diff --git a/src/cli/tools/java/index.ts b/src/cli/tools/java/index.ts index 95c957ded..4a89996d7 100644 --- a/src/cli/tools/java/index.ts +++ b/src/cli/tools/java/index.ts @@ -100,7 +100,7 @@ export class JavaPrepareService extends BasePrepareService { await createMavenSettings(this.pathSvc); await createGradleSettings(this.pathSvc); - if (!(await this.pathSvc.toolEnvExists(this.name))) { + if (!(await this.pathSvc.toolEnvExists('gradle'))) { // fix: Failed to load native library 'libnative-platform.so' for Linux amd64. await this.pathSvc.exportToolEnv( 'gradle', diff --git a/test/java/Dockerfile b/test/java/Dockerfile index 123418283..0934e97f9 100644 --- a/test/java/Dockerfile +++ b/test/java/Dockerfile @@ -226,6 +226,25 @@ RUN install-tool gradle RUN install-tool maven +#-------------------------------------- +# test: readonly +#-------------------------------------- +FROM base AS test-readonly + +RUN prepare-tool java + +# fake reaonly +RUN set -ex; \ + chmod -R g-w /opt/containerbase; \ + chown -R root /opt/containerbase; \ + rm -rf /tmp/containerbase; \ + true + +USER 12021 + +RUN ls -la /tmp +RUN containerbase-cli init tool java + #-------------------------------------- # final #-------------------------------------- @@ -238,3 +257,4 @@ COPY --from=test-gradle-d /.dummy /.dummy COPY --from=test-maven-a /.dummy /.dummy COPY --from=test-others /.dummy /.dummy COPY --from=test-latest-version /.dummy /.dummy +COPY --from=test-readonly /.dummy /.dummy diff --git a/tools/test.js b/tools/test.js index 1e4e3a52a..1e55f5032 100644 --- a/tools/test.js +++ b/tools/test.js @@ -33,7 +33,7 @@ class TestCommand extends Command { if (this.debug) { shell.echo('Debug mode enabled'); env.CONTAINERBASE_DEBUG = '1'; - env.BUILDKIT_PROGRESS = '1'; + env.BUILDKIT_PROGRESS = 'plain'; } if (this.logLevel) {