Skip to content

Commit

Permalink
rm nonroot
Browse files Browse the repository at this point in the history
  • Loading branch information
alvicsam committed Dec 4, 2024
1 parent 3f29429 commit bfedee6
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 34 deletions.
48 changes: 24 additions & 24 deletions .github/workflows/integration-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,37 +18,37 @@ env:
VERSION: ${{ github.sha }}

jobs:
build_image:
name: Build image
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- name: Check out the repo
uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v.4.2.0
# build_image:
# name: Build image
# runs-on: ubuntu-latest
# timeout-minutes: 30
# steps:
# - name: Check out the repo
# uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v.4.2.0

- name: npm build
run: |
cd javascript
npm install
npm dedupe
npm run clean
npm run build
# - name: npm build
# run: |
# cd javascript
# npm install
# npm dedupe
# npm run clean
# npm run build

- name: Build Docker image
uses: docker/build-push-action@4f58ea79222b3b9dc2c8bbdd6debcef730109a75 # v6.9.0
with:
file: ./scripts/ci/docker/zombienet_injected.Dockerfile
context: .
push: false
tags: |
${{ env.IMAGE_NAME }}:${{ env.VERSION }}
${{ env.IMAGE_NAME }}:latest
# - name: Build Docker image
# uses: docker/build-push-action@4f58ea79222b3b9dc2c8bbdd6debcef730109a75 # v6.9.0
# with:
# file: ./scripts/ci/docker/zombienet_injected.Dockerfile
# context: .
# push: false
# tags: |
# ${{ env.IMAGE_NAME }}:${{ env.VERSION }}
# ${{ env.IMAGE_NAME }}:latest

build_push_image:
name: Build and Push Docker image to Docker Hub
runs-on: ubuntu-latest
timeout-minutes: 30
needs: [build_image]
# needs: [build_image]
steps:
- name: Check out the repo
uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v.4.2.0
Expand Down
21 changes: 11 additions & 10 deletions scripts/ci/docker/zombienet_injected.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,14 @@ RUN gcloud components install kubectl
#
# Static GID/UID is also useful for chown'ing files outside the container where
# such a user does not exist.
RUN groupadd --gid 10001 nonroot && \
useradd --home-dir /home/nonroot \
--create-home \
--shell /bin/bash \
--gid nonroot \
--groups nonroot \
--uid 10000 nonroot

# RUN groupadd --gid 10001 nonroot && \
# useradd --home-dir /home/nonroot \
# --create-home \
# --shell /bin/bash \
# --gid nonroot \
# --groups nonroot \
# --uid 10000 nonroot

WORKDIR /home/nonroot/zombie-net
COPY javascript/packages ./packages
Expand All @@ -44,7 +45,7 @@ COPY tests ./tests
COPY javascript/package.json ./
COPY javascript/package-lock.json ./
RUN npm install --production
RUN chown -R nonroot. /home/nonroot
# RUN chown -R nonroot. /home/nonroot

# RUN ls -la /home/nonroot/zombie-net/packages/cli/dist

Expand All @@ -54,9 +55,9 @@ RUN ln -s /home/nonroot/zombie-net/packages/cli/dist/cli.js /usr/local/bin/zombi

# Dependency for run test script when run inside container
RUN mkdir -p /var/log/zombie-net
RUN chown -R nonroot. /var/log/zombie-net
# RUN chown -R nonroot. /var/log/zombie-net
RUN mkdir -p /etc/zombie-net
RUN chown -R nonroot. /etc/zombie-net
# RUN chown -R nonroot. /etc/zombie-net

# Use the non-root user to run our application
# USER nonroot
Expand Down

0 comments on commit bfedee6

Please sign in to comment.