# Schemeorg cookbook Docker recipe feedback

**URL:** <https://forum.systemcrafters.net/t/schemeorg-cookbook-docker-recipe-feedback/1422>\
**Category:** General\
**Created:** [February 27, 2025, 4:15pm UTC](https://forum.systemcrafters.net/t/schemeorg-cookbook-docker-recipe-feedback/1422 "2025-02-27T16:15:07Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Retropikzel](https://yyz1.discourse-cdn.com/flex029/user_avatar/forum.systemcrafters.net/retropikzel/32/572_2.png) [@Retropikzel](https://forum.systemcrafters.net/u/Retropikzel)\
**Post date:** [February 27, 2025, 4:15pm UTC](https://forum.systemcrafters.net/t/schemeorg-cookbook-docker-recipe-feedback/1422/1 "2025-02-27T16:15:07Z")

</div>

Hello! I just made a new recipe for Scheme cookbook about how to run Scheme code with different implementations to test it’s portability.

> <https://github.com/schemedoc/cookbook/issues/74>
>
> \## Problem
> 
> You want to write portable code and to test it with multiple impleme…ntations. However installing them can be cumbersome and time consuming.
> 
> \## Solution
> 
> Running the code in a container using Docker.
> 
> 
> \### Running a script
> 
> We mount the current working directory inside the container to /workdir and run file called test.scm. Replace the SCHEME\\\_NAME with the name of the Scheme you want to use, for example "guile". And replace SCHEME\\\_GOMMAND with command you want to run, for example "guile".
> 
> \`\`\`shell
> docker run -v "$PWD:/workdir" -it schemers/SCHEME\_NAME bash -c "cd /workdir && SCHEME\_COMMAND test.scm"
> \`\`\`
> 
> If you also need to install some packages inside the container it is better to create a Dockerfile and pass the implementation name as argument. Build it and then run container using the built image.
> 
> Here is and example of such Dockerfile in which Scheme implementation is passed as and argument. Then we install the packages we need, just curl here for example. Then we set the workdir inside the Dockerfile so we dont need to set it in the command.
> 
> \`\`\`dockerfile
> ARG SCHEME=
> FROM schemers/${SCHEME}
> RUN apt-get update && apt-get install -y curl
> WORKDIR /workdir
> \`\`\`
> 
> Then we build it using tag my-scheme and run it. Just like previously replace SCHEME\\\_NAME and SCHEME\\\_COMMAND with implementation and command you want.
> 
> \`\`\`shell
> docker build . --build-arg SCHEME=SCHEME\_NAME --tag=my-scheme
> docker run -v "$PWD:/workdir" my-scheme bash -c "SCHEME\_COMMAND test.scm"
> \`\`\`
> 
> \### Opening a REPL
> 
> See \[https://containers.scheme.org/\](https://containers.scheme.org/).
> 
> \### Notes
> 
> \- Windows
> - You might need to replace the current directory environment variable, $PWD, with %cd%.
> \- Containers and tags
> - All the containers and tags can be found in \[Schemers Docker hub\](https://hub.docker.com/u/schemers)
> 
> Credit: @Retropikzel

I included a note about what needs to be changed to run it on windows, but since I’m not a windows user I thought I’d ask here for people who run windows to test if the commands work as is? Any other feedback is also appriciated! 🙂
