Upgrading the Docker container of Rakudo Star

A few week ago we saw how to get started with Perl 6 in a Docker container. Since then a new version of Rakudo Star was release (version 2017.04) and I wanted to see how can I upgrade it.

In a nutshell: I need to start from scratch.

Note! This site is about Perl 6.
If you are looking for a solution for Perl 5, please check out the Perl 5 tutorial.

Assuming you have followed the instructions using Docker with Perl 6 you can restart the Docker container again:

docker start rakudo && docker attach rakudo

and then run perl6 -v to see the version of Rakudo:

root@5367bca6f844:/# perl6 -v
This is Rakudo version 2017.01 built on MoarVM version 2017.01
implementing Perl 6.c.

It is out of date as the most recent release of Rakudo Star was 2017.04

Upgrade Docker Image

Let's start by listing the Docker images we have on the system:

$ docker images
REPOSITORY          TAG                 IMAGE ID            CREATED             SIZE
rakudo-star         latest              8b00c91fa5c0        7 weeks ago         334 MB

Use the pull command to fetch the newer version of the already downloaded image:

$ docker pull rakudo-star

Then check the images again:

docker images
REPOSITORY          TAG                 IMAGE ID            CREATED             SIZE
rakudo-star         latest              118af315b797        5 weeks ago         338 MB
rakudo-star         <none>              8b00c91fa5c0        7 weeks ago         334 MB

Remove old image

At this point I tried to remove the old image, but Docker did not let me do it:

$ docker rmi 8b00c91fa5c0
Error response from daemon: conflict: unable to delete 8b00c91fa5c0 (must be forced) - image is being used by stopped container 5367bca6f844

So I listed all the Docker containers I had:

$ docker ps -a
CONTAINER ID        IMAGE               COMMAND             CREATED             STATUS                      PORTS               NAMES
5367bca6f844        rakudo-star         "bash"              56 minutes ago      Exited (0) 5 seconds ago                        rakudo
4af6f99aab3d        rakudo-star         "perl6"             About an hour ago   Exited (0) 54 minutes ago                       cocky_lalande

and removed them:

$ docker rm 5367bca6f844 4af6f99aab3d

Then I could remove the old and outdated image:

$ docker rmi 8b00c91fa5c0

Start new Docker image

At this point I basically have a clean system. The Docker image is already here, but all the installation I did are gone. So I start from scratch launching a new Docker container:

docker run -it --name rakudo -v $(pwd):/opt rakudo-star bash

Then checking the version of Perl 6:

root@fcc044e9bb30:/# perl6  -v
This is Rakudo version 2017.04.3 built on MoarVM version 2017.04-53-g66c6dda
implementing Perl 6.c.

So we have the newer version now.

Install additional packages and Perl 6 modules

Then we can install the additional Linux packages we might need:

# apt-get update
# apt-get -y upgrade
# apt-get -y install less make gcc

and the Perl 6 modules we wanted for our experimental Perl 6 code.

# zef install Terminal::Readsecret

Check out the previous article for two sample Perl 6 scripts.

The Perl 6 Tricks and Treats newsletter has been around for a while. If you are interested to get special notification when there is new content on this site, it is the best way to keep track:
Full name:
This is a newsletter temporarily running on my personal site ( using Mailman, till I implement an alternative system in Perl 6.
Gabor Szabo
Written by Gabor Szabo

Published on 2017-06-15


In the comments, please wrap your code snippets within <pre> </pre> tags and use spaces for indentation.
comments powered by Disqus
Suggest a change
Elapsed time: 2.467070184

Support my Perl 6 book!

I am writing a book on Web Application Development in Perl 6 and raising money via crowdfunding. Please support my effort!

Perl 6 Tricks and Treats newsletter

Register to the free newsletter now, and get updates and news.