From 018c7d095817067a5c5931a2c6995b98542c7a69 Mon Sep 17 00:00:00 2001 From: Tim Daly Date: Fri, 13 Feb 2015 23:47:22 -0500 Subject: Dockerfile fix bug 7299: update docker image to include gcc --- Dockerfile | 17 +++ Dockerfile.howto | 222 ++++++++++++++++++++++++++++++++++++++++ buglist | 23 ++-- changelog | 4 + patch | 3 +- src/axiom-website/patches.html | 2 + 6 files changed, 258 insertions(+), 13 deletions(-) create mode 100644 Dockerfile create mode 100644 Dockerfile.howto diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..1bc77e7 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,17 @@ +# cd /root/docker +# docker build . +# ubuntu 12.04 +FROM 28a945b4333c +MAINTAINER Tim Daly +RUN apt-get update +RUN apt-get install -y libxpm-dev gcc +ADD axiom-ubuntu-aug2014-bin.tgz /usr/local +ADD axiom /usr/local/bin +RUN chmod a+x /usr/local/bin/axiom + +# when it completes then run +# docker ps -l +# 12345abcdef +# docker commit 12345abcdef daly/axiom +# docker login +# docker push daly/axiom diff --git a/Dockerfile.howto b/Dockerfile.howto new file mode 100644 index 0000000..ae3880f --- /dev/null +++ b/Dockerfile.howto @@ -0,0 +1,222 @@ +This is how I made an Axiom docker image. + +It is actually rather simple, although it takes a fair amount +of reading to make it "simple". Let me smooth the path for you. + +On ubuntu, as root (docker wants to be root initially) + +1) there is an app called docker which is not the docker we want + + apt-get remove docker + +2) we need to install docker + + apt-get install -y docker.io + +3) next we need to fetch a container (actually many containers) + + docker pull ubuntu + +4) see what images you have + + docker images + +5) select one of them. I chose ubuntu 12.04 since that version + has worked well in the past for me. The exact image can be + selected using the IMAGE ID column. + +7) make a working directory. Files in this directory will be available + during the docker build step. + + mkdir /root/docker + +6) make a tar image which would be the subtree you would + get from an installed version of your program. Axiom installs are + in /usr/local/axiom so I did + + cd /usr/local + tar -zcf /root/docker/axiom.tgz axiom + +7) copy your shell script to /root/docker + + cd /root/docker + cp /usr/local/bin/axiom . + +8) make a Dockerfile file + + emacs -nw Dockerfile + +9) add a set of docker commands (by convention they are uppercase) + + # ubuntu 12.04 + FROM 28a945b4333c + MAINTAINER Tim Daly + # update the image to the latest repos + RUN apt-get update + # for X11 connections to hyperdoc + RUN apt-get install -y libxpm-dev gcc + # untar the program into the image at /usr/local + ADD axiom.tgz /usr/local + # put the command in the path + ADD axiom /usr/local/bin + # make the axiom command executable by everyone + RUN chmod a+x /usr/local/bin/axiom + +9) save the Dockerfile (note that case is important) + +10) run the docker build + + cd /root/docker + docker build . + + +11) find out the ID of the latest image you just made, which is + the hash code under CONTAINER ID + + docker ps -l + +CONTAINER ID +12345abcde + +12) commit the container with all of the changes (Note that + doing anything with the container interatively will lose + changes you don't commit) + + docker commit 12345abcde daly/axiom + +13) check that you now have a new image + + docker images + +14) create a userid on the docker hub.docker.com (e.g. daly) + +15) push the daly/axiom image to the hub + + docker login + docker push daly/axiom + + +The whole process should take about 1 hour. Some more details.... + +================================================================ +3) next we need to fetch a container (actually many containers) + + docker pull ubuntu + +> If you know the IMAGE ID you don't have to do the pull +> because the docker build command will do it for you. + + + + +================================================================ +5) select one of them. I chose ubuntu 12.04 since that version + has worked well in the past for me. The exact image can be + selected using the IMAGE ID column. + +>The key advantage of Docker is that you can isolate yourself +from the underlying operating system. I chose ubuntu 12.04 +>because that's the opsys on my master machine. + + + + +================================================================ +7) make a working directory. Files in this directory will be available + during the docker build step. + + mkdir /root/docker + +>Be careful what you put in this directory. The whole directory +>will be cloned so the build process can import files. You don't +>want to import sensitive information. + + + + +================================================================ +6) make a tar image which would be the subtree you would + get from an installed version of your program. Axiom installs are + in /usr/local/axiom so I did + + cd /usr/local + tar -zcf /root/docker/axiom.tgz axiom + +>The docker build process knows to untar/decompress tgz files +>so this will be decompressed automatically + + + + +================================================================ +9) add a set of docker commands (by convention they are uppercase) + +>The docker build runs by starting the image and then executing +>the commands from the Dockerfile in the image. The files in +>the named subdirectory are directly accessed so make sure you +>copy what you need to a subdirectory (which I called docker) + +>Note that I used the exact IMAGE ID I wanted (ubuntu 12.04) +>docker will fetch that image if it is not locally available. + # ubuntu 12.04 + FROM 28a945b4333c + + MAINTAINER Tim Daly + +>If you need to install anything you can use the RUN command +>which executes command line functions. + # update the image to the latest repos + RUN apt-get update + +>You should specify the "-y" (yes) switch since there is no +>console interaction available + # for X11 connections to hyperdoc + RUN apt-get install -y libxpm-dev + +>docker knows how to unpack several file formats automatically +>into the location of the second argument + # untar axiom into the image at /usr/local + ADD axiom.tgz /usr/local + +>and it knows how to copy files to the second argument + # put the command in the path + ADD axiom /usr/local/bin + + # make the command executable by everyone + RUN chmod a+x /usr/local/bin/axiom + + + + + + + +================================================================ +10) run the docker build + + cd /root/docker + docker build . + +>docker build is going to use the files in the named directory (.) +>to modify the original image (ubuntu) to make a new image. + + + + +================================================================ +12) commit the container with all of the changes (Note that + doing anything with the container interatively will lose + changes you don't commit) + + docker commit 12345abcde daly/axiom + +>note that the image name "daly/axiom" should have your docker +>hub userid (daly) as the first element + +>You can run the new image to test it. Note that any changes +>you make to the image will not be saved unless you do a commit. +>Commands that need I/O (such as bash) need the -i -t switches to +>give them stdio. To test your new image do: +> +> docker run -i -t daly/axiom axiom + diff --git a/buglist b/buglist index 9797b49..b050308 100644 --- a/buglist +++ b/buglist @@ -12,17 +12,6 @@ dup 50006: nonextend 60077: ========================================================================= -bug 7299: docker image does not contain GCC - -example from bookvol0: - -p(10) - Compiling function p with type Integer -> Polynomial(Fraction(Integer)) - Compiling function p as a recurrence relation - -sh: 1: gcc: not found - -========================================================================= bug 7296: connect from VIEW2D is not graph specific The connect function in VIEW2D globally turns lines on or off. @@ -41723,3 +41712,15 @@ factor(t1) reported on 25 Jan 2015 by Ralf Hemmecke +fixed by 20150213 +========================================================================= +bug 7299: docker image does not contain GCC + +example from bookvol0: + +p(10) + Compiling function p with type Integer -> Polynomial(Fraction(Integer)) + Compiling function p as a recurrence relation + +sh: 1: gcc: not found + diff --git a/changelog b/changelog index 5638009..0367602 100644 --- a/changelog +++ b/changelog @@ -1,3 +1,7 @@ +20150213 tpd src/axiom-website/patches.html 20150213.01.tpd.patch +20150213 tpd Dockerfile fix bug 7299: update docker image to include gcc +20150213 tpd Dockerfile.howto gives instructions to create Docker image +20150213 tpd buglist: fix bug 7299 20150207 tpd src/axiom-website/patches.html 20150207.02.tpd.patch 20150207 tpd zips/clm Common Lisp manual in PDF 20150207 tpd src/axiom-website/patches.html 20150207.01.tpd.patch diff --git a/patch b/patch index 4004045..6302cba 100644 --- a/patch +++ b/patch @@ -1,3 +1,2 @@ -zips/clm Common Lisp manual in PDF +Dockerfile fix bug 7299: update docker image to include gcc -Add first cut at common lisp documentation diff --git a/src/axiom-website/patches.html b/src/axiom-website/patches.html index 3402e5f..904c310 100644 --- a/src/axiom-website/patches.html +++ b/src/axiom-website/patches.html @@ -4988,6 +4988,8 @@ axiom.sty introduce 'laws' environment
zips/cltl2_latex2e.tgz Common Lisp manual 20150207.02.tpd.patch zips/clm Common Lisp manual in PDF +20150213.01.tpd.patch +Dockerfile fix bug 7299: update docker image to include gcc -- 1.7.5.4