diff --git a/make/photon/portal/Dockerfile b/make/photon/portal/Dockerfile index 9e9a389b721..314880bb6d5 100644 --- a/make/photon/portal/Dockerfile +++ b/make/photon/portal/Dockerfile @@ -6,9 +6,6 @@ WORKDIR /build_dir ARG npm_registry=https://registry.npmjs.org -RUN apt-get update \ - && apt-get install -y --no-install-recommends python-yaml - COPY ./api/v2.0/swagger.yaml /build_dir/swagger.yaml COPY src/portal /build_dir @@ -16,7 +13,8 @@ ENV NPM_CONFIG_REGISTRY=${npm_registry} RUN npm install --unsafe-perm RUN npm run generate-build-timestamp RUN node --max_old_space_size=2048 'node_modules/@angular/cli/bin/ng' build --configuration production -RUN python -c 'import sys, yaml, json; y=yaml.load(sys.stdin.read()); print json.dumps(y)' < swagger.yaml > dist/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));" COPY ./LICENSE /build_dir/dist