From 6a6dea64a08741721dc8ef760465330f0c096c7a Mon Sep 17 00:00:00 2001 From: AllForNothing Date: Thu, 4 May 2023 15:52:43 +0800 Subject: [PATCH] Replace python script with node script for portal Dockerfile Signed-off-by: AllForNothing --- make/photon/portal/Dockerfile | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/make/photon/portal/Dockerfile b/make/photon/portal/Dockerfile index 137836a57ad1..ebdc694b58c9 100644 --- a/make/photon/portal/Dockerfile +++ b/make/photon/portal/Dockerfile @@ -10,9 +10,8 @@ COPY src/portal/package.json /build_dir COPY src/portal/package-lock.json /build_dir COPY ./api/harbor/swagger.yaml /build_dir -RUN apt-get update \ - && apt-get install -y --no-install-recommends python-yaml=3.12-1 \ - && python -c 'import sys, yaml, json; y=yaml.load(sys.stdin.read()); print json.dumps(y)' < swagger.yaml > swagger.json \ +RUN npm install js-yaml@4.1.0 \ + && node -e "const yaml = require('js-yaml'); const fs = require('fs'); const swagger = yaml.load(fs.readFileSync('swagger.yaml', 'utf8')); fs.writeFileSync('swagger.json', JSON.stringify(swagger));" \ && npm install COPY ./LICENSE /build_dir