diff --git a/.github/workflows/docker.yaml b/.github/workflows/docker.yaml index ddeccecd056..cb5dbbb5b54 100644 --- a/.github/workflows/docker.yaml +++ b/.github/workflows/docker.yaml @@ -25,17 +25,8 @@ jobs: registry: ${{ env.HUB }} username: ${{ github.actor }} password: ${{ secrets.GITHUB_TOKEN }} - - name: Set up Python2 - run: | - sudo apt-get update - sudo apt-get install python2 -y - name: Build run: | - sudo npm install -g npm@latest - sudo npm install -g node-gyp@latest - sudo npm install -g node-sass@latest - - yarn - yarn build + docker build -f build/Dockerfile -o type=local,dest=./out . - docker buildx build --platform linux/amd64,linux/arm64 -f build/Dockerfile.dapper -t ${HUB}/ks-console:v3.3.2 --push . \ No newline at end of file + ls -la ./out \ No newline at end of file diff --git a/build/Dockerfile b/build/Dockerfile index 529b18594a2..8f7a1734505 100644 --- a/build/Dockerfile +++ b/build/Dockerfile @@ -30,23 +30,3 @@ RUN mv /kubesphere/server/locales \ /kubesphere/server/config.yaml /out/server/ #RUN ["/bin/bash", "-c", "mv /kubesphere/server/{locales,public,sample,views,config.yaml} /out/server/"] RUN mv /kubesphere/package.json /out/ - -############## -# Final Image -############## -FROM node:14-alpine as base_os_context - -RUN adduser -D -g kubesphere -u 1002 kubesphere && \ - mkdir -p /opt/kubesphere/console && \ - chown -R kubesphere:kubesphere /opt/kubesphere/console - -WORKDIR /opt/kubesphere/console -COPY --from=builder /out/ /opt/kubesphere/console/ - -RUN mv dist/server.js server/server.js -USER kubesphere - -EXPOSE 8080 - -CMD ["npm", "run", "serve"] -