Minimalistic Diesel CLI container.
Run Diesel CLI:
docker run willsquire/diesel-cli
A practical example with setup
:
docker run --rm \
-v "$(pwd)":/app \
--network="project_name_default" \
willsquire/diesel-cli \
--database-url="mysql://username:password@db_service/db_name" \
setup
Note:
-v
is the Rust project containing the migrates and config for Diesel.
--database-url
is the database Diesel will connect to.
--network
is needed only if the database is running within an existing docker network, e.g. in docker-compose
. Usually the network name is the current directory name appended with _default
.
See Diesel's docs for a full command list
Use in builds:
FROM willsquire/diesel-cli as builder
COPY . .
RUN diesel setup