In a nutshell: I need to start from scratch.
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
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
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
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.
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.
Published on 2017-06-15