J1 Docker is a Docker Image
to manage all development and run-time
processes for J1 Template. The image contains, beside of Jekyll and
a full set of RubyGems, all development dependencies like the languages
Ruby, Python and NodeJS ready to use.
jekyllone/j1dev
: Development imagejekyllone/j1app
: Web Application image
The development image jekyllone/j1dev
can be used to run all development
processes for:
j1_template_mde_dev
, the Developer package for J1 on Githubj1_template_mde
, a RubyGem to create run-time versions
export JEKYLL_VERSION=3.8
docker run --rm \
--volume=$PWD:/srv/jekyll \
-p 35729:35729 -p 40000:40000 \
-it jekyllone/j1dev:latest \
j1 serve --incremental
J1 Docker will attempt to install any dependencies that you list inside
of your Gemfile
, matching the versions you have in your Gemfile.lock
,
including Jekyll if you have a version that does not match the version of
the image you are using (you should be doing gem "jekyll", "~> 3.8"
so
that minor versions are installed if you use say image tag "3.7.3").
If you provide a Gemfile
and would like to update your Gemfile.lock
you can run:
export JEKYLL_VERSION=3.8
docker run --rm \
--volume="$PWD:/srv/jekyll" \
-it jekyllone/j1dev:latest \
bundle update
J1 images support jekyll-reload. All you need do is to configure it according to your needs.
export JEKYLL_VERSION=3.8
docker run --rm \
--volume=$PWD:/srv/jekyll \
-p 35729:35729 -p 40000:40000 \
-it jekyllone/j1dev:latest \
j1 serve --incremental --livereload
You can build images or any specific tag of an image running
bundle exec docker-template build
or
bundle exec docker-template build repo:tag
It's simple like that to build images!
Example:
bundle exec docker-template build j1dev:latest --no-push
bundle exec docker-template clean
This will print you all untagged images
docker images ls -a | grep "^<none>" | awk "{print $3}"
This filtering also works for dangling volumes. To remove all those images run:
docker rm $(docker images ls -a | grep "^<none>" | awk "{print $3}")
docker image ls -a | grep -v "^<none>"
To have a look inside an image, run a container using a bash (shell):
docker run --rm \
--name j1_develop \
--hostname j1_develop \
--volume=$PWD:/srv/jekyll \
-it jekyllone/j1dev:3.8 bash
=======
This will print you all untagged images
docker image ls -a | grep "^<none>" | awk "{print $3}"
docker image ls -a | grep "^<none>" | sed 's/ */ /g' | cut -d" " -f 3
This filtering also works for dangling volumes. To remove all those images run:
docker image rm --force $(docker image ls -a | grep "^<none>" | awk "{print $3}") --force
docker image rm --force $(docker image ls -a | grep "^<none>" | sed 's/ */ /g' | cut -d" " -f 3)
To have a look inside an image, run a container using a bash (shell):
docker run --rm \
--name j1_develop \
--hostname j1_develop \
--volume=$PWD:/srv/jekyll \
-it jekyllone/j1dev:latest bash
docker images --format '{{.Size}}\t{{.Repository}}:{{.Tag}}\t{{.ID}}' | sort -r | column -t
== What are docker none-none images?
See: https://www.projectatomic.io/blog/2015/07/what-are-docker-none-none-images/ See: https://github.com/justone/dockviz
docker image ls -f dangling=true -q