Skip to content

Commit

Permalink
supports rootless docker
Browse files Browse the repository at this point in the history
  • Loading branch information
reederc42 committed Apr 12, 2024
1 parent 86f4795 commit 642988e
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 15 deletions.
1 change: 0 additions & 1 deletion .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,6 @@ jobs:
--rm \
-v ${{ github.workspace }}:${{ github.workspace }} \
-w ${{ github.workspace }} \
-u 1000:1000 \
wiki-ci:build-$BUILD_ID \
sh -c 'cargo build --bin ci'
Expand Down
22 changes: 11 additions & 11 deletions images/build.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,30 +2,30 @@ ARG NODE_VERSION="21.7.3"

FROM node:${NODE_VERSION}

USER root:root

ARG NPM_VERSION="10.5.2"
ARG RUST_VERSION="1.77.2"

RUN npm install --verbose -g npm@${NPM_VERSION}

USER 1000:1000
RUN [ "$(npm --version)" = "${NPM_VERSION}" ] || npm install --verbose -g npm@${NPM_VERSION}

ENV PATH=$PATH:/home/node/.cargo/bin
ENV PATH=$PATH:/root/.cargo/bin
RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --default-toolchain ${RUST_VERSION}

WORKDIR /ci
COPY --chown=1000:1000 ./ui/package.json .
COPY --chown=1000:1000 ./ui/package-lock.json .
COPY ./ui/package.json .
COPY ./ui/package-lock.json .
RUN npm install --verbose

RUN mkdir wiki
RUN cd wiki &&\
cargo new ci &&\
cargo new tools &&\
cargo new wiki
COPY --chown=1000:1000 ./Cargo.lock ./wiki/
COPY --chown=1000:1000 ./Cargo.toml ./wiki/
COPY --chown=1000:1000 ./ci/Cargo.toml ./wiki/ci/
COPY --chown=1000:1000 ./tools/Cargo.toml ./wiki/tools/
COPY --chown=1000:1000 ./wiki/Cargo.toml ./wiki/wiki/
COPY ./Cargo.lock ./wiki/
COPY ./Cargo.toml ./wiki/
COPY ./ci/Cargo.toml ./wiki/ci/
COPY ./tools/Cargo.toml ./wiki/tools/
COPY ./wiki/Cargo.toml ./wiki/wiki/
RUN cd wiki &&\
cargo fetch -vv
8 changes: 5 additions & 3 deletions images/e2e.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,11 @@ ARG CYPRESS_VERSION=

FROM cypress/factory:3.5.4

USER 1000:1000
ARG NPM_VERSION="10.5.2"

RUN [ "$(npm --version)" = "${NPM_VERSION}" ] || npm install --verbose -g npm@${NPM_VERSION}

WORKDIR /ci
COPY --chown=1000:1000 ./ui/package.json .
COPY --chown=1000:1000 ./ui/package-lock.json .
COPY ./ui/package.json .
COPY ./ui/package-lock.json .
RUN npm install --verbose

0 comments on commit 642988e

Please sign in to comment.