diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..72e8ffc --- /dev/null +++ b/.dockerignore @@ -0,0 +1 @@ +* diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..8373b0b --- /dev/null +++ b/Dockerfile @@ -0,0 +1,19 @@ +FROM ubuntu:latest +MAINTAINER Gareth Rushgrove "gareth@puppet.com" + +ARG LIBRAL_DOWNLOAD_LOCATION="http://download.augeas.net/libral/" +ARG LIBRAL_FILENAME="ralsh-latest.tgz" + +RUN apt-get update && \ + apt-get install --no-install-recommends -y wget && \ + wget "${LIBRAL_DOWNLOAD_LOCATION}${LIBRAL_FILENAME}" && \ + tar zxvf "$LIBRAL_FILENAME" -C /opt && \ + apt-get remove --purge -y wget && \ + apt-get autoremove -y && \ + apt-get clean && \ + rm -rf /var/lib/apt/lists/* && \ + rm "$LIBRAL_FILENAME" + +ENV PATH=/opt/ral/bin:$PATH + +ENTRYPOINT ["/opt/ral/bin/ralsh"] diff --git a/README.md b/README.md index 73f8d6d..89f782e 100644 --- a/README.md +++ b/README.md @@ -45,6 +45,27 @@ In case you do need to build from source, which is not required for provider development, only if you want to work on the core libral library, [this document](HACKING.md) contains instructions on building `libral`. + +### Docker + +You can also try out `libral` in the context of a Docker container. The +Dockerfile in the repository allows for building an image quickly based +on the above mentioned precompiled tarball. + +``` +docker build -t puppet/libral . +``` + +Running this can then be done with Docker, for instance the following +invocation will launch `ralsh` in the context of the container. + +``` +docker run --rm -t puppet/libral +``` + +This is intended for exploring the CLI and experimenting with providers. + + ## Usage After you build `libral`, or after you download and unpack the