1. Running OE in a Docker container
- Posted by axtens_bruce Aug 14, 2022
- 982 views
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.
So I've got some questions about the Dockerfile. Currently I'm doing this:
FROM ubuntu:18.04 RUN apt-get update && apt-get install jq tar gzip tar file curl build-essential wget -y WORKDIR /opt ENV PATH=$PATH:/usr/bin RUN wget https://gist.githubusercontent.com/silvernode/2a4e993ab4ef415788400d237c977fd4/raw/4b9d03bebeca4a97eb25b5be83165a969347d225/geuphoria.sh -O geuphoria.sh RUN chmod +x geuphoria.sh RUN ./geuphoria.sh install
I build that with
>docker build . -t euphoria:4.1
and then run it with
>docker run -i -t euphoria:4.1
When presented with the prompt of the Linux in the container I try to use one of the Euphoria binaries and get the following
root@730481fa0e6b:/opt# file /usr/bin/eui /usr/bin/eui: broken symbolic link to /usr/local/euphoria-4.1.0-Linux-x64/bin/eui
How do I fix this?
Bruce
2. Re: Running OE in a Docker container
- Posted by ghaberek (admin) Aug 14, 2022
- 919 views
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.
- Docker: https://hub.docker.com/r/openeuphoria/euphoria
- GitHub: https://github.com/OpenEuphoria/docker-euphoria
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
3. Re: Running OE in a Docker container
- Posted by axtens_bruce Aug 14, 2022
- 996 views
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.
Hallelujah, that simplifies things ENORMOUSLY. Thank you!
I'm taking submissions for exercises. See Tasks list for a list of exercises. A learning track should have at least 20 of these in hand before launch. Each task is linked to the full blurb on Exercism. Please write the code as a function which can be called by a testing routine. I know there are a tonne over at RosettaCode. Oh yeah, and when this gets off the ground, we'll need folk to mentor learners.
-- Bruce