Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions .github/workflows/tools-rippled.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,8 @@ env:
DOXYGEN_VERSION: 1.9.8+ds-2build5
GCC_VERSION: 14
GRAPHVIZ_VERSION: 2.42.2-9ubuntu0.1
NODE_VERSION: 24.5.0
NODE_VERSION: 24.6.0
NPM_VERSION: 11.5.2
NVM_VERSION: 0.40.3
PRETTIER_VERSION: 3.6.2
PRE_COMMIT_VERSION: 4.2.0
UBUNTU_VERSION: noble
Expand Down Expand Up @@ -98,7 +97,6 @@ jobs:
GRAPHVIZ_VERSION=${{ env.GRAPHVIZ_VERSION }}
NODE_VERSION=${{ env.NODE_VERSION }}
NPM_VERSION=${{ env.NPM_VERSION }}
NVM_VERSION=${{ env.NVM_VERSION }}
PRETTIER_VERSION=${{ env.PRETTIER_VERSION }}
PRE_COMMIT_VERSION=${{ env.PRE_COMMIT_VERSION }}
context: docker/tools-rippled
Expand Down
23 changes: 9 additions & 14 deletions docker/tools-rippled/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# This argument must be defined before the base image, so it can be used in the
# prettier image, which does not derive from the base image, below.
ARG NODE_VERSION

# ====================== BASE IMAGE ======================
ARG UBUNTU_VERSION
FROM ubuntu:${UBUNTU_VERSION} AS base
Expand Down Expand Up @@ -71,11 +75,8 @@ FROM base AS documentation
# This is not inherited from base image.
ARG DEBIAN_FRONTEND=noninteractive

# Install cmake, required to build the `docs` target.
# Install cmake.
ARG CMAKE_VERSION
ENV VIRTUAL_ENV=/opt/venv
RUN python3 -m venv ${VIRTUAL_ENV}
ENV PATH=${VIRTUAL_ENV}/bin:${PATH}
RUN pip install --no-cache cmake==${CMAKE_VERSION}

# Install make, GCC and create the necessary symlinks.
Expand Down Expand Up @@ -122,22 +123,16 @@ WORKDIR ${HOME}
# ====================== PRETTIER IMAGE ======================
# Note, we do not install a compiler here.

FROM base AS prettier
FROM node:${NODE_VERSION}-alpine AS prettier

# This is not inherited from base image.
ARG DEBIAN_FRONTEND=noninteractive
# Install bash and git.
RUN apk add --no-cache bash git

# Install node and npm via nvm, and then install prettier, see also
# https://nodejs.org/en/download.
ARG NODE_VERSION
# Update NPM and install prettier.
ARG NPM_VERSION
ARG NVM_VERSION
ARG PRETTIER_VERSION
ENV NPM_CONFIG_REGISTRY=https://registry.npmjs.org
RUN <<EOF
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v${NVM_VERSION}/install.sh | bash
\. "${HOME}/.nvm/nvm.sh"
nvm install ${NODE_VERSION}
npm install -g --no-audit --no-fund npm@${NPM_VERSION}
npm install -g --no-audit --no-fund prettier@${PRETTIER_VERSION}
npm cache clean --force
Expand Down
6 changes: 2 additions & 4 deletions docker/tools-rippled/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ docker login ${CONTAINER_REGISTRY} -u "${GITHUB_USER}" --password-stdin

### Building and pushing the Docker image

Currently this Dockerfile can be used to build one image:
Currently, this Dockerfile can be used to build one image:

* `clang-format` with C++ formatting tools. This image requires parameters:
* `UBUNTU_VERSION` for selection of Ubuntu release (recommended `noble`)
Expand Down Expand Up @@ -89,9 +89,8 @@ registry.

```shell
UBUNTU_VERSION=noble
NODE_VERSION=24.5.0
NODE_VERSION=24.6.0
NPM_VERSION=11.5.2
NVM_VERSION=0.40.3
PRETTIER_VERSION=3.6.2
CONTAINER_IMAGE=xrplf/ci/tools-rippled-prettier:latest

Expand All @@ -102,7 +101,6 @@ docker buildx build . \
--build-arg BUILDKIT_INLINE_CACHE=1 \
--build-arg NODE_VERSION=${NODE_VERSION} \
--build-arg NPM_VERSION=${NPM_VERSION} \
--build-arg NVM_VERSION=${NVM_VERSION} \
--build-arg PRETTIER_VERSION=${PRETTIER_VERSION} \
--build-arg UBUNTU_VERSION=${UBUNTU_VERSION} \
--tag ${CONTAINER_REGISTRY}/${CONTAINER_IMAGE}
Expand Down