-
Notifications
You must be signed in to change notification settings - Fork 192
Using Slate in Docker
Provided in the slate repo is a Dockerfile you can use to run slate using Docker, as well as providing pre-built images on Docker Hub. Docker is similar to Vagrant in that it provides a reproducible, portable development environment using virtualization, however it does not provide a full VM, rather piggy backing off the host, allowing for a slimmer installation profile than Vagrant / full VMs. However, Docker does come with a number of its own terms, and for beginners, we recommend looking at this Glossary to familiarize yourself with some of them.
- Fork this repository on Github.
- Clone your forked repository (not our original one) to your hard drive with
git clone https://github.com/YOURUSERNAME/slate.git
cd slate
- Grab the slate image (
docker pull slatedocs/slate
) or build the docker image for the repository (docker build . -t slatedocs/slate
).
To use Docker to just build your site, run:
docker run --rm --name slate -v $(pwd)/build:/srv/slate/build -v $(pwd)/source:/srv/slate/source slatedocs/slate
If you wish to run the development server for Slate to aid in working on the site, run:
docker run --rm --name slate -p 4567:4567 -v $(pwd)/source:/srv/slate/source slatedocs/slate serve
and you will be able to access your site at http://localhost:4567 until you stop the running container process.
The next step is to learn how to edit source/index.md
to change the content of your docs. Once you're done, you might want to think about deploying your docs.