запустить бота на сервере через докер.
В терминале пишет следующие шаги и ошибку:
root@31-31-199-82:/home/bot_app_dart# sudo docker build -t dart-server .
Sending build context to Docker daemon 83.46kB
Step 1/12 : FROM dart:stable AS build
---> 91437c5c4a32
Step 2/12 : WORKDIR /app
---> Using cache
---> 2d0ae818c77d
Step 3/12 : COPY pubspec.* ./
---> Using cache
---> 89f193705327
Step 4/12 : RUN dart pub get
---> Using cache
---> 35ed8b7e4c84
Step 5/12 : COPY . .
---> Using cache
---> 89ef75d1609d
Step 6/12 : RUN dart pub get --offline
---> Using cache
---> 60f0af1c8ff1
Step 7/12 : RUN dart compile exe bin/bot_app.dart -o bin/server
---> Running in 135e3dd64fb0
Error: AOT compilation failed
Generating AOT kernel dill failed!
The command '/bin/sh -c dart compile exe bin/bot_app.dart -o bin/server' returned a non-zero code: 64
Докерфайл следующего содержания:
# Specify the Dart SDK base image version using dart:<version> (ex: dart:2.12)
FROM dart:stable AS build
# Resolve app dependencies.
WORKDIR /app
COPY pubspec.* ./
RUN dart pub get
# Copy app source code and AOT compile it.
COPY . .
# Ensure packages are still up-to-date if anything has changed
RUN dart pub get --offline
RUN dart compile exe bin/bot_app.dart -o bin/server
# Build minimal serving image from AOT-compiled `/server` and required system
# libraries and configuration files stored in `/runtime/` from the build stage.
FROM scratch
COPY --from=build /runtime/ /
COPY --from=build /app/bin/server /app/bin/
# Start server.
EXPOSE 8080
CMD ["/app/bin/server"]
Что может быть не так?
Generating AOT kernel dill failed!
Обсуждают сегодня