Jekyll on windows using docker


| 0 Comments

docker

recently i installed docker on windows. i need to manage this blog but don’t want any complexity (e.g. installed ruby, setting up dependencies).

first i installed docker.

some issues in running docker:

  • The running command stopped because the preference variable “ErrorActionPreference” or common parameter is set to Stop

    solution: unintall docker and restart the system, then again install docker

  • Docker fails to start - MobyLinuxVM.vhdx already exists, unable to create MobyLinuxVM

    solution: reference

    • exit the application
    • Stop-Service com.docker.service
    • cd ‘C:\Program Files\Docker\Docker\resources’
    • .\MobyLinux.ps1 -Destroy
    • check that the VHDX file (C:\Users\Public\Public Documents\Hyper- V\Virtual hard disks\MobyLinuxVM.vhdx) is removed
    • .\MobyLinux.ps1 -Create

now docker running as expected.

next:

setting up blog in docker (blog is based on jekyll and hosted on github)

  • download Kitematic
  • install this image starefosson/github-pages
  • mount hard drive (e.g. C:/ where your repo exists) from docker settings -> Shared Drives and select the drive and apply. (tip: use full username e.g. WORKGROUP/Name of User)
  • now go to your blog repository and run (in powershell):
1
docker run -v "$(pwd):/usr/src/app" -p "4000:4000" starefossen/github-pages


this will create a new cotainer and mount current directory (blog) to /usr/src/app which use to serve blog on localhost:4000


now you can rename the new container (e.g. blog) and run it via powershell after starting the docker.

1
docker start -i blog