Re: Running OE in a Docker container

new topic     » goto parent     » topic index » view thread      » older message » newer message
axtens_bruce said...

And why am I running it in a Docker container? Because ultimately I want to be able to have an Euphoria learning track on Exercism. I was part of the team that recently launched the COBOL track. I'm in the middle of building a track for 8th. A Docker image helps with running unit tests so that students can program Euphoria in the Exercism website not just on their own local command line.

Hi Bruce! I set up a Docker organization for OpenEuphoria a while ago. We have a simple euphoria Docker image based debian:latest. I recommend using that instead if you can.

axtens_bruce said...

So I've got some questions about the Dockerfile. Currently I'm doing this:

[snip]

How do I fix this?

Looks like you're trying to use this silvernode install script? That looks very complicated for what it needs to do. All you really need to do is extract the package to /usr/local and then symlink the exectuables in the bin directory to /usr/local/bin. You can pipe the download file directly from curl into tar to avoid having to create and delete any temporary files.

FYI each RUN instruction in your Dockerfile adds a new layer to the image, so it's best to chain multiple commands together with &&. You can use \\ to break up the command into multiple lines. See Best practices for more info. Here is a working Dockerfile that should accomplish what you need. Also I'm pretty sure tar and gzip are already in the base image so you can skip those.

FROM ubuntu:18.04 
RUN apt-get update && apt-get install jq file curl build-essential wget -y \ 
    && curl -sL "https://github.com/OpenEuphoria/euphoria/releases/download/4.1.0/euphoria-4.1.0-Linux-x64-57179171dbed.tar.gz" | tar -xzC /usr/local \ 
    && cd /usr/local/bin && find /usr/local/euphoria-4.1.0-Linux-x64/bin -type f -executable -exec ln -s {} \; 

Build:

$ docker build . -t euphoria:4.1 
[lots of output] 

Run:

$ docker run -i -t euphoria:4.1 
root@20abe43f5322:/# which eui 
/usr/local/bin/eui 
root@20abe43f5322:/# file /usr/local/bin/eui 
/usr/local/bin/eui: symbolic link to /usr/local/euphoria-4.1.0-Linux-x64/bin/eui 
root@20abe43f5322:/# file /usr/local/euphoria-4.1.0-Linux-x64/bin/eui 
/usr/local/euphoria-4.1.0-Linux-x64/bin/eui: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, for GNU/Linux 2.6.24, BuildID[sha1]=a13af4f2c1df88bf46f7e155c61175881aa7a6b7, not stripped 
root@20abe43f5322:/# eui -v 
Euphoria Interpreter v4.1.0 development 
   64-bit Linux, Using System Memory 
   Revision Date: 2015-02-02 14:18:53, Id: 5861:57179171dbed 

P.S. a couple forum formatting tips:

  • Use {{{ and }}} tags for plain-text blocks. The <eucode> tags are for syntax highlighting Euphoria code specifically.
  • In your signature you used -- which is the strikeout tag in Creole. You can use a tilde to escape that, like this: ~-- Bruce
  • If you "Reply with quote" on my response, you can see how I've formatted everything.

-Greg

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

Search



Quick Links

User menu

Not signed in.

Misc Menu