Did you know that you can navigate the posts by swiping left and right?
I’ve been working with a really fantastic f# to javascript compiler called fable. Basically I can write f# programs, compile to javascript, and run in browser, node, or electron.
Fable has gone through a lot of changes the past year, and the latest version, 1.0, relies on dotnet core. While that seems a very nice idea, dotnet core itself is pretty new and tends to segfault on my platform of choice, Debian unstable.
You can muck around and make it work, but since unstable is well, unstable, those changes have a tendancy to be undone with updates. So I thought I’d try to make a docker image with all the goodies.
Here’s how:
docker pull microsoft/dotnet:1.0.4-sdk
docker run -it microsoft/dotnet:1.0.4-sdk
curl -sL https://deb.nodesource.com/setup_7.x | bash -
apt-get install -y nodejs
apt-get install -y build-essential
npm install --global yarn
/etc/passwd
and remember the numeric iduseradd -m yourusername
/etc/passwd
is the same as host, change if notdocker ps
docker commit containerid yourhandle/yourimagename
exit
the interactive shell sessiondocker run --user 1000 -v /z/aolney:/z/aolney -it aolney/fable-dotnet-104
This command:
aolney/fable-dotnet-104
Once the command is executed I can go to the relevant fable repo and start issuing dotnet core commands, have them update the host file system with correctly permissioned files, and generally be happy.
In the case of the awesome recent fable-getting-started, I would head over to the directory in question, dotnet restore GettingStarted.sln
, yarn install
, and then yarn run watch
. An overview of the Fable 1.0 project structure and dotnet commands is here.
I considered adding vscode to the image, but with the frequent changes it sees, I didn’t want to bother with updating and committing all the time. Maybe I will change my mind about that later. Something else that could potentially be improved is where dotnet restore keeps things. Currently this in in the container, to things will disappear when the container is restarted.