dart-lang / sdk

The Dart SDK, including the VM, JS and Wasm compilers, analysis, core libraries, and more.
https://dart.dev
BSD 3-Clause "New" or "Revised" License
10.3k stars 1.59k forks source link

Doesn't work with Huggingface docker hosting #59630

Closed neoapps-dev closed 2 days ago

neoapps-dev commented 2 days ago

here's my Dockerfile,

FROM debian:bullseye-slim
RUN apt-get update && apt-get install -y \
    wget \
    unzip \
    libssl-dev \
    && apt-get clean
RUN wget -O /tmp/dart-sdk.zip https://storage.googleapis.com/dart-archive/channels/stable/release/latest/sdk/dartsdk-linux-x64-release.zip \
    && unzip /tmp/dart-sdk.zip -d /usr/lib \
    && rm /tmp/dart-sdk.zip
ENV PATH="/usr/lib/dart-sdk/bin:$PATH"
WORKDIR /app
COPY . .
RUN dart pub get
RUN mkdir -p /app/.dart-tool /tmp/.dart && chmod -R 777 /app/.dart-tool /tmp/.dart
EXPOSE 8080
CMD ["dart", "run", "bin/main.dart"]

and the error, ===== Application Startup at 2024-11-28 22:26:40 =====

An unexpected error was encountered by the Dart CLI. Please file an issue at https://github.com/dart-lang/sdk/issues/new with the following details:

Invocation: 'dart run bin/main.dart' Exception: 'PathAccessException: Creation failed, path = '/.dart-tool' (OS Error: Permission denied, errno = 13)' Stack Trace:

0 _Directory.createSync (dart:io/directory_impl.dart:124:7)

1 _File.createSync (dart:io/file_impl.dart:303:14)

2 ForwardingFile.createSync (package:file/src/forwarding/forwarding_file.dart:26:16)

3 createConfigFile (package:unified_analytics/src/initializer.dart:27:14)

4 runInitialization (package:unified_analytics/src/initializer.dart:88:5)

5 new Analytics (package:unified_analytics/src/analytics.dart:82:22)

6 createUnifiedAnalytics (package:dartdev/src/unified_analytics.dart:23:10)

7 DartdevRunner.runCommand (package:dartdev/dartdev.dart:169:27)

8 CommandRunner.run. (package:args/command_runner.dart:122:25)

9 new Future.sync (dart:async/future.dart:313:27)

10 CommandRunner.run (package:args/command_runner.dart:122:14)

11 runDartdev (package:dartdev/dartdev.dart:47:29)

12 main (file:///b/s/w/ir/x/w/sdk/pkg/dartdev/bin/dartdev.dart:13:11)

13 _delayEntrypointInvocation. (dart:isolate-patch/isolate_patch.dart:293:33)

14 _RawReceivePort._handleMessage (dart:isolate-patch/isolate_patch.dart:184:12)

i tried everything but i couldn't get it to work

dart-github-bot commented 2 days ago

Summary: Dart application fails to start inside a Docker container due to a permission denied error when creating the .dart-tool directory. The error originates from the unified_analytics package.

neoapps-dev commented 2 days ago

okay.. i ditched dart:mirrors and now my app works with AOT