xref: /imagick/docker/nixos/Dockerfile (revision d15a015b)
1# Start from the latest NixOS unstable.
2FROM nixos/nix
3RUN nix-channel --add https://nixos.org/channels/nixpkgs-unstable nixpkgs
4RUN nix-channel --update
5
6# Prepare the build environment.
7# This is appropriate for production or CI containers, but for
8# development environments, it's better to leave the shell.nix
9# where it is, so that updates to it don't require a rebuild of the
10# container, as that is annoying to do.
11# COPY shell.nix /opt
12# RUN nix-shell /opt/shell.nix --run 'echo OK'
13
14# Keep a symlink to ImageMagick headers.
15RUN nix-build '<nixpkgs>' -A imagemagick7.dev -o /opt/imagemagick
16
17# Prepare the README.
18COPY README.md /opt/
19RUN sed -i \
20  -e "s|@@IM_DEV@@|$(readlink -f /opt/imagemagick-dev)|g" \
21  /opt/README.md
22
23# Make the default directory the mounted source code.
24WORKDIR /var/app
25
26# Run the process that this container will serve.
27CMD tail -f /opt/README.md
28