Re: Docker containers for OpenEuphoria, and other development updates
- Posted by ghaberek (admin) Feb 28, 2021
- 1231 views
petelomax said...
How hard would it be to make Phix docker image?
Not hard at all! Here's my base image, Dockerfile.euphoria:
$ cat Dockerfile.euphoria FROM debian LABEL maintainer="Greg Haberek <ghaberek@gmail.com>" ADD euphoria-4.1.0-Linux-x64-57179171dbed.tar.gz /usr/local/ ENV PATH=/usr/local/euphoria-4.1.0-Linux-x64/bin:$PATH
- FROM - starts with the latest Debian image (I tried Alpine but it uses a different libc that's not compatible with Euphoria)
- LABEL - sets me as the maintainer of this image (show to users via the docker inspect command)
- ADD - extracts the Euphoria 4.1 package to the /usr/local/ directory (already downloaded to local directory via build.sh)
- ENV - sets the path to the bin directory of the extracted files.
And that's it! You can test it by dropping into a shell:
docker run -it --rm openeuphoria/euphoria /bin/bash
The commands above are:
- docker run - run a new container
- -it - start an interactive container (-i) with a pseudo terminal (-t)
- --rm - remove the container when it exits (this will discard any changes made in the container!)
- openeuphoria/euphoria - the repository and container name (optional tag can be added, like :latest or :4.1.0)
- /bin/bash - the command to run in the container, this will give you a Bash shell for testing
In this case I also benefit from dropping the existing Euphoria files into the same location referenced in the provided eu.cfg, so I don't have to change any of that.
If you look at Dockerfile.euphoria-mvc you can see I have to do some work with sed to inject the new include path into the system eu.cfg file:
$ cat Dockerfile.euphoria-mvc FROM openeuphoria/euphoria LABEL maintainer="Greg Haberek <ghaberek@gmail.com>" ADD euphoria-mvc-1.13.0.tar.gz /usr/local/ RUN sed -i 's@-i /usr/local/euphoria-4.1.0-Linux-x64/include@-i /usr/local/euphoria-4.1.0-Linux-x64/include\n-i /usr/local/euphoria-mvc-1.13.0/include@' /usr/local/euphoria-4.1.0-Linux-x64/bin/eu.cfg
-Greg