Docker setup for gitlab

I try to setup jekyll website on gitlab. How to add a dockerfile to jekyll website to fast the build process. Can i cache the docker. I found a code

export JEKYLL_VERSION=3.8
docker run --rm \
  --volume="$PWD:/srv/jekyll" \
  -it jekyll/jekyll:$JEKYLL_VERSION \
  jekyll build

Where to add this code?