Skip to content

Commit

Permalink
build image
Browse files Browse the repository at this point in the history
  • Loading branch information
rainbend committed Apr 22, 2024
1 parent 6c84627 commit 223f633
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 31 deletions.
13 changes: 2 additions & 11 deletions .github/workflows/docker.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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 .
ls -la ./out
20 changes: 0 additions & 20 deletions build/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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"]

0 comments on commit 223f633

Please sign in to comment.