Re: Docker containers for OpenEuphoria, and other development updates

new topic     » goto parent     » topic index » view thread      » older message » newer message
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 

  1. FROM - starts with the latest Debian image (I tried Alpine but it uses a different libc that's not compatible with Euphoria)
  2. LABEL - sets me as the maintainer of this image (show to users via the docker inspect command)
  3. ADD - extracts the Euphoria 4.1 package to the /usr/local/ directory (already downloaded to local directory via build.sh)
  4. 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

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu