Skip to content

Commit

Permalink
Build watchexec in a docker image used for the feature spec
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexB52 committed Dec 5, 2024
1 parent 6950d60 commit 9d6f1a5
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 16 deletions.
1 change: 0 additions & 1 deletion bin/test/watchexec-ruby-app
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,3 @@ bundle exec rake build
# cp -R features/support features/watchexec-ruby-app/retest
ls -t pkg | head -n1 | xargs -I {} mv pkg/{} features/watchexec-ruby-app/retest.gem
docker compose -f features/watchexec-ruby-app/docker-compose.yml up --build --exit-code-from retest
# docker compose -f features/watchexec-ruby-app/docker-compose.yml up --exit-code-from retest
12 changes: 12 additions & 0 deletions builds/dockerfiles/WatchexecSlimBullseye
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# Stage 1: Build watchexec with Rust
FROM rust:1.83.0-slim-bullseye AS rust-builder

# Install necessary dependencies for Rust
RUN apt-get update -qq && \
apt-get install --no-install-recommends -y build-essential git

# Install watchexec
RUN cargo install watchexec-cli

# Verify installation
RUN watchexec --version
16 changes: 1 addition & 15 deletions features/watchexec-ruby-app/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,17 +1,3 @@
# Stage 1: Build watchexec with Rust
FROM rust:1.83.0-slim-bullseye AS rust-builder

# Install necessary dependencies for Rust
RUN apt-get update -qq && \
apt-get install --no-install-recommends -y build-essential git

# Install watchexec
RUN cargo install watchexec-cli

# Verify installation
RUN watchexec --version

# Stage 2: Ruby application setup
FROM ruby:2.7-slim-bullseye

# Install necessary dependencies
Expand All @@ -20,7 +6,7 @@ RUN apt-get update -qq && \
apt-get clean && rm -rf /var/lib/apt/lists/*

# Copy watchexec from the Rust stage
COPY --from=rust-builder /usr/local/cargo/bin/watchexec /usr/local/bin/watchexec
COPY --from=ghcr.io/alexb52/slim-bullseye-watchexec:latest /usr/local/cargo/bin/watchexec /usr/local/bin/watchexec

# Verify watchexec installation in the final image
RUN watchexec --version
Expand Down

0 comments on commit 9d6f1a5

Please sign in to comment.