Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -90,9 +90,9 @@ Generation or repair completing does not mean every candidate passes. Inspect bo

## Docker

Run `docker/docker-build` from the repository root to prepare an image with the required toolchain. Mirrors can be configured in `docker/Dockerfile` if needed.
Run `docker/docker-build` to prepare an image with the pinned analysis toolchain, Python, and cargo-llvm-cov. Both Docker scripts locate the repository from their own paths. Mirrors can be configured in `docker/Dockerfile` if needed.

Run `docker/docker-run` from the same directory to mount the repository at `/home/palm/palm` in the container. In the container, change to that directory and follow [Installation](#installation).
Run `docker/docker-run` to open a shell in the repository mounted at `/home/palm/palm`, then follow [Installation](#installation). The container is removed when the shell exits; files written in the mounted repository remain on the host. Use working copies of target crates as described above.

## Development checks

Expand Down
13 changes: 8 additions & 5 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ ARG TARGETARCH
RUN apt update && apt upgrade -y \
&& apt install -y ca-certificates \
# Install packages
&& apt install -y build-essential git curl wget vim \
&& apt install -y build-essential git curl wget vim python3 \
sudo \
zsh zsh-autosuggestions zsh-syntax-highlighting \
&& rm -rf /var/lib/apt/lists/* \
Expand All @@ -26,6 +26,7 @@ RUN apt update && apt upgrade -y \

USER $USERNAME
WORKDIR /home/$USERNAME
ENV PATH="/home/${USERNAME}/.cargo/bin:${PATH}"

RUN sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)" \
&& sed -i 's/^ZSH_THEME=.*/ZSH_THEME="ys"/' ~/.zshrc \
Expand All @@ -36,10 +37,12 @@ RUN sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master
&& . "$HOME/.cargo/env" \
# Set mirror for crates.io
# ...
&& rustup install nightly-2025-03-19 \
&& rustup component add --toolchain nightly-2025-03-19 rust-src rustc-dev llvm-tools-preview \
&& host=$(rustc -vV | grep '^host:' | cut -d' ' -f2); \
curl --proto '=https' --tlsv1.2 -fsSL \
&& rustup toolchain install nightly-2025-03-19 --profile minimal \
--component rust-src --component rustc-dev --component llvm-tools-preview --component rust-analyzer \
&& rustup default nightly-2025-03-19

RUN host=$(rustc -vV | grep '^host:' | cut -d' ' -f2) \
&& curl --proto '=https' --tlsv1.2 -fsSL \
"https://github.com/taiki-e/cargo-llvm-cov/releases/download/v0.6.16/cargo-llvm-cov-$host.tar.gz" \
| tar xzf - -C "$HOME/.cargo/bin"

Expand Down
14 changes: 8 additions & 6 deletions docker/docker-build
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
#!/usr/bin/bash
set -e
#!/usr/bin/env bash
set -euo pipefail

repo_root="$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")/.." && pwd)"

readonly DOCKER_IMAGE_NAME="palm"
readonly DOCKER_FILE="docker/Dockerfile"
readonly DOCKER_FILE="$repo_root/docker/Dockerfile"
readonly DOCKER_USER="palm"

docker build \
-t $DOCKER_IMAGE_NAME \
-f $DOCKER_FILE \
-t "$DOCKER_IMAGE_NAME" \
-f "$DOCKER_FILE" \
--build-arg=USERNAME="$DOCKER_USER" \
. 1>&2
"$repo_root/docker" 1>&2
15 changes: 7 additions & 8 deletions docker/docker-run
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
#!/usr/bin/bash
#!/usr/bin/env bash

set -e
set -euo pipefail

readonly DOCKER_USER="palm"
readonly CONTAINER_NAME="palm"
readonly PWD=`pwd`
repo_root="$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")/.." && pwd)"

docker run -it \
-v "${PWD}:/home/${DOCKER_USER}/palm" \
--name "${CONTAINER_NAME}" palm
readonly DOCKER_USER="palm"
docker run --rm -it \
-v "${repo_root}:/home/${DOCKER_USER}/palm" \
-w "/home/${DOCKER_USER}/palm" palm
Loading