Skip to content

Commit

Permalink
Replace python script with node script for portal Dockerfile
Browse files Browse the repository at this point in the history
Signed-off-by: AllForNothing <sshijun@vmware.com>
  • Loading branch information
AllForNothing committed May 8, 2023
1 parent 3069231 commit bf47a24
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions make/photon/portal/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit bf47a24

Please # to comment.