В VS2022 создайте новый проект и выберите следующее:

Выберите «Включить поддержку контейнеров»:

Скопируйте файл dockerfile в корневой каталог решения. Я не сделал ни одного изменения. Я заархивировал все решение и загрузил его в свой экземпляр AWS EC2 под управлением Linux:
Код: Выделить всё
NAME="Amazon Linux"
VERSION="2"
ID="amzn"
ID_LIKE="centos rhel fedora"
VERSION_ID="2"
PRETTY_NAME="Amazon Linux 2"
ANSI_COLOR="0;33"
CPE_NAME="cpe:2.3:o:amazon:amazon_linux:2"
HOME_URL="https://amazonlinux.com/"
SUPPORT_END="2025-06-30"
Amazon Linux release 2 (Karoo)
Код: Выделить всё
docker build -t certificate-test -f Dockerfile .
Код: Выделить всё
> [publish 1/1] RUN dotnet publish "./Certificate.Server.csproj" -c Release -o /app/publish /p:UseAppHost=false:
1.279 Determining projects to restore...
1.771 All projects are up-to-date for restore.
2.387 Certificate.Server -> /src/Certificate.Server/bin/Release/net8.0/Certificate.Server.dll
2.623
2.624 > certificate.client@0.0.0 build
2.624 > vite build
2.625
3.771 There was an error exporting the HTTPS developer certificate to a file.
3.778 failed to load config from /src/certificate.client/vite.config.js
3.778 error during build:
3.780 EXEC : error : Could not create certificate. [/src/certificate.client/certificate.client.esproj]
3.780 at file:///src/certificate.client/vite.config.js.timestamp-1730140703203-0346fa3ab0456.mjs:24:11
3.781 at ModuleJob.run (node:internal/modules/esm/module_job:234:25)
3.781 at async ModuleLoader.import (node:internal/modules/esm/loader:473:24)
3.781 at async loadConfigFromBundledFile (file:///src/certificate.client/node_modules/vite/dist/node/chunks/dep-BWSbWtLw.js:66691:15)
3.781 at async loadConfigFromFile (file:///src/certificate.client/node_modules/vite/dist/node/chunks/dep-BWSbWtLw.js:66532:24)
3.785 at async resolveConfig (file:///src/certificate.client/node_modules/vite/dist/node/chunks/dep-BWSbWtLw.js:66140:24)
3.785 at async build (file:///src/certificate.client/node_modules/vite/dist/node/chunks/dep-BWSbWtLw.js:65237:18)
3.785 at async CAC. (file:///src/certificate.client/node_modules/vite/dist/node/cli.js:828:5)
3.792 /root/.nuget/packages/microsoft.visualstudio.javascript.sdk/1.0.1184077/Sdk/Sdk.targets(312,5): error MSB3073: The command "npm run build" exited with code 1. [/src/certificate.client/certificate.client.esproj]
Как мне создать сертификат в Linux?
Спасибо
Подробнее здесь: https://stackoverflow.com/questions/791 ... r-on-linux
Мобильная версия