Install Runme with Docker
You can containerize your Runme notebook using Docker. This method enables easy deployment of notebook across different environments, including cloud computing platforms,CI/CD pipelines , and/or local test environments.
Docker Image
Docker images for each released version of Runme are available on Docker Hub. To get the latest version, use the following command:
docker pull statefulhq/runme:latest
Basic Usage
Use the default working directory:
docker run -it --volume $(pwd):/opt/var/runme statefulhq/runme
Changing the working directory:
docker run -it -w /runbooks --volume /your/runbooks:/runbooks statefulhq/runme
Passing the --project
flag:
docker run -it --volume /your/runbooks:/runbooks statefulhq/runme --project /runbooks
Below is an example Dockerfile illustrating how to containerizing your application:
FROM statefulhq/runme:latest as build
WORKDIR /app
COPY example_runme.md .
RUN echo "Installing dependencies..."
# Continue with your Runme configuration and usage
ENTRYPOINT ["/opt/bin/runme", "--filename", "example_runme.md"]
Additional Considerations
ARM64 Architecture:
If you are using an ARM64 architecture, include the --platform=linux/arm64
flag:
docker run --platform=linux/arm64 -it --volume $(pwd):/opt/var/runme statefulhq/runme
Multi-Stage Build
Consider using a multi-stage Docker build to bring and install your dependencies before finalizing the Runme image. Below is an example Dockerfile illustrating this approach:
# Stage 1: Dependency_Stage
FROM statefulhq/runme:latest as dependency_stage
WORKDIR /app
COPY example_runme.md .
ENTRYPOINT ["/opt/bin/runme", "--filename", "example_runme.md"]
# Stage 2: Runme Stage
FROM statefulhq/runme:latest as build
WORKDIR /app
COPY --from=Dependency_Stage /app /app
RUN echo "Installing dependencies..."
# Cmmand to run when the container start
CMD ["python", "app.py"]
In this example, the first stage is dedicated to installing dependencies, and the second stage builds upon the first, incorporating the necessary files and configurations for Runme.
Keep going!
Explore further customization options and integration possibilities.