Skip to content

Commit

Permalink
KF Centraldashboard: update base image (#92)
Browse files Browse the repository at this point in the history
* update build for branch

* revert alpine version to 16

* Update Dockerfile

* Update Dockerfile

* Remove stable from packages

* update pug

* Delete package-lock.json

* Create package-lock.json

* update package-lock

* Update package-lock.json

* Update Dockerfile

* jose commit to have branch

* testing things

* squash and credit Saffa

* check and test workflow

* Update build-centraldashboard.yml

update

* trigger build?

* fix build issues

* test allowedlist

* hi

* take out allowedlist

* rm allowedlist

* squash

* cleanup workflows

Co-authored-by: saffaalvi <alvi118@uwindsor.ca>
Co-authored-by: Saffa Alvi <saffa.alvi@canada.ca>
  • Loading branch information
3 people authored and Bryan Paget committed Sep 9, 2022
1 parent 5abf0d9 commit d7398af
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 25 deletions.
24 changes: 11 additions & 13 deletions .github/workflows/build-centraldashboard.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,24 +33,22 @@ jobs:
docker rmi $(docker image ls -aq)
df -h
# Container build and push to a Azure Container registry (ACR)
- name: Docker build/push
# Container build to a Azure Container registry (ACR)
- name: Docker build
run: |
docker build \
-t ${{ env.REGISTRY_NAME }}.azurecr.io/kubeflow/centraldashboard:${{ github.sha }} \
--build-arg kubeflowversion=$(git describe --abbrev=0 --tags) \
--build-arg commit=$(git rev-parse HEAD) \
components/centraldashboard/
docker push ${{ env.REGISTRY_NAME }}.azurecr.io/kubeflow/centraldashboard:${{ github.sha }}
docker tag ${{ env.REGISTRY_NAME }}.azurecr.io/kubeflow/centraldashboard:${{ github.sha }} \
${{ env.REGISTRY_NAME }}.azurecr.io/kubeflow/centraldashboard:${GITHUB_REF#refs/*/}
docker push ${{ env.REGISTRY_NAME }}.azurecr.io/kubeflow/centraldashboard:${GITHUB_REF#refs/*/}
# Comment out for now while https://github.com/Azure/container-scan/issues/122 is still open
# ALSO should re-order this to actuall have it block the push if there is a critical severity
# Scan image for vulnerabilities
#- uses: Azure/container-scan@v0
# with:
# image-name: ${{ env.REGISTRY_NAME }}.azurecr.io/kubeflow/centraldashboard:${{ github.sha }}
# severity-threshold: CRITICAL
# run-quality-checks: false
- uses: Azure/container-scan@v0
with:
image-name: ${{ env.REGISTRY_NAME }}.azurecr.io/kubeflow/centraldashboard:${{ github.sha }}
severity-threshold: CRITICAL
run-quality-checks: false
- name: Docker push
run: |
docker push ${{ env.REGISTRY_NAME }}.azurecr.io/kubeflow/centraldashboard:${{ github.sha }}
# Push once, https://github.com/StatCan/kubeflow/pull/87
30 changes: 18 additions & 12 deletions components/centraldashboard/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# Step 1: Builds and tests
FROM node:12.22.12-alpine AS build
# This is a long-lived tag, if there is a vulnerability
# sometimes a rebuild will set you on your way.
FROM node:16-alpine AS build

ARG kubeflowversion
ARG commit
Expand All @@ -13,11 +15,14 @@ RUN apk update && apk upgrade && \
echo @stable http://nl.alpinelinux.org/alpine/v3.15/community >> /etc/apk/repositories && \
echo @stable http://nl.alpinelinux.org/alpine/v3.15/main >> /etc/apk/repositories

RUN apk add --no-cache bash chromium@stable nss@stable \
freetype@stable \
harfbuzz@stable \
ttf-freefont@stable \
libstdc++@stable
RUN apk add --no-cache \
bash \
chromium \
nss \
freetype \
harfbuzz \
ttf-freefont \
libstdc++

RUN if [ "$(uname -m)" = "aarch64" ]; then \
apk update && apk upgrade && \
Expand All @@ -31,16 +36,17 @@ RUN npm rebuild && \
if [ "$(uname -m)" = "aarch64" ]; then \
export CFLAGS=-Wno-error && \
export CXXFLAGS=-Wno-error && \
npm install; \
npm install --legacy-peer-deps; \
else \
npm install; \
npm install --legacy-peer-deps; \
fi && \
npm test && \
npm run build && \
npm prune --production

# --legacy-peer-deps is required in the update to node16
# https://github.com/pugjs/pug-loader/issues/126#issuecomment-796517327
npm run build --legacy-peer-deps && \
npm prune --production --legacy-peer-deps
# Step 2: Packages assets for serving
FROM node:12.22.12-alpine AS serve
FROM node:16-alpine AS serve

ENV NODE_ENV=production
WORKDIR /app
Expand Down

0 comments on commit d7398af

Please sign in to comment.