Giter Site home page Giter Site logo

asdf-alpine's Introduction

asdf-alpine

This repo provides Dockerized versions of asdf supported tool sets.

An image can provide one or more asdf tools, you can for example create a image with just erlang, or erlang+elixir or erlang+elixir+node, basically anything that asdf supports.

There's also an asdf-ubuntu sister repo.

Images

The list of built images can be found at dockerhub and you can find their source branch on github.

Status Dockerfile
Travis branch FROM vborja/asdf-alpine:elixir-1.4.4-otp-19
Travis branch FROM vborja/asdf-alpine:elixir-1.4.5-otp-19
Travis branch FROM vborja/asdf-alpine:elixir-1.4.5-otp-20
Travis branch FROM vborja/asdf-alpine:elixir-1.5.0-nodejs-8.2.1
Travis branch FROM vborja/asdf-alpine:elixir-1.5.0-otp-20
Travis branch FROM vborja/asdf-alpine:elixir-1.5.0-rc.2-otp-20
Travis branch FROM vborja/asdf-alpine:erlang-19.3
Travis branch FROM vborja/asdf-alpine:erlang-20.0
Travis branch FROM vborja/asdf-alpine:master
Travis branch FROM vborja/asdf-alpine:nodejs-8.2.1

Build

Images are built automatically for every branch and published at dockerhub.

The master branch provides the base Dockerfile for all other branches. See the Repo Layout section for more information on how to create more images.

Every branch name must be a valid docker tag name that specifies the tool names and versions it provides, for example:

erlang-20.0 and elixir-1.5.0-rc.2-otp-20

This way people can either base their own Docker images on them or try any existing tool set published as an image, like latest elixir:

docker run --rm -ti vborja/asdf-alpine:elixir-1.5.0-rc.2-otp-20 iex

Contributing new tool sets or versions.

All contributions are more than welcome, if you'd like to help expanding the number of tools available as docker images that would be really great!

If you want to create a new version, just start a new branch from the old-version, and send a PR, be sure to build the image locally and test if the tool works as expected.

If you are adding a new unrelated tool, please create an orphan branch, for example

git clone https://github.com/vic/asdf-alpine
cd asdf-alpine

# start working on a new node image
git checkout --orphan nodejs-8.2.1
rm * # clean the branch files


echo 'FROM vborja/asdf-alpine' > Dockerfile
# Read the following section about Repo layout

# build it
docker build . -t nodejs-8.2.1

# try it
docker run --rm -ti nodejs-8.2.1 node

# commit and create a new PR when everything is ok.

If you create a new branch be sure to add the .travis.yml file so that the image for that branch is built automatically.

Repo layout

The master Dockerfile from this repo serves as base for all asdf-alpine images. It's single purpose is to create an asdf user with home /asdf, add the asdf shim directory to PATH, along with a asdf-install-toolset.

Your repo can contain as many asdf tools as you want, the following example is taken from erlang-20.0 branch.

/
  Dockerfile    # 
  
  erlang/       # the directory name must be the same as the tool name.
    version     # stores the erlang version as expected by asdf
    plugin-repo # stores the erlang tool plugin url.
    build-deps  # an script run as root to install system dependencies
    build-env   # an script run as asdf user sourced before asdf install.  
    
  other/        # another tool with the same file structure

The Dockerfile content typically looks like:

FROM vborja/asdf-alpine

# Pull latest asdf
RUN asdf update --head

# start erlang install
COPY erlang .asdf/toolset/erlang/
USER root
RUN bash .asdf/toolset/erlang/build-deps
USER asdf
RUN asdf-install-toolset erlang

# install other tool if needed
COPY other .asdf/toolset/other/
USER root
RUN bash .asdf/toolset/other/build-deps
USER asdf
RUN asdf-install-toolset other

Some images like elixir-1.5.0-rc.2-otp-20 start from a previous one, in this case from (erlang 20.0) and just add another tool into it.

asdf-alpine's People

Contributors

github-actions[bot] avatar smorimoto avatar vic avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

asdf-alpine's Issues

`docker run vborja/asdf-alpine` does not work

docker run vborja/asdf-alpine does not work as expected. That is, asdf is only available within a Dockerfile derived from asdf-alpine but not within docker run vborja/asdf-alpine <command>

Steps to reproduce:

sudo docker run --rm -it vborja/asdf-alpine:latest bash -i -c 'cat ~/.bashrc'

Output:

cat: can't open '/asdf/.bashrc': No such file or directory

Similarly, when using asdf as command (instead of cat ~/.bashrc), it cannot be found.

Meanwhile docker building a Dockerfile with the following contents produces the expected output:

FROM vborja/asdf-alpine

RUN whoami
RUN cat ~/.bashrc
RUN cat ~/.profile

RUN asdf

The reason seems to be that, at least according to this source, ONBUILD RUN commands (like the ones in the asdf-alpine's Dockerfile) only get executed when basing a new image upon the image containing the commands. docker running asdf-alpine therefore does not work.

Hence, I would suggest replacing ONBUILD RUN with a mere RUN.

Add Haskell

I was trying to add haskell but I was not successful.

My branch: https://github.com/nelsonmestevao/asdf-alpine/tree/ne/haskell-8.8.1

Step 6/6 : RUN  asdf-install-toolset haskell
 ---> Running in 7d248a42555b
ERROR: Unable to lock database: Permission denied
ERROR: Failed to open apk database: Permission denied
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
100   621    0   621    0     0    386      0 --:--:--  0:00:01 --:--:--   386
100 13.8M  100 13.8M    0     0  2086k      0  0:00:06  0:00:06 --:--:-- 3380k
Installing Haskell 8.8.1 (ghc-8.8.1)
STACK_ROOT=/asdf/.asdf/installs/haskell/8.8.1/stack
/asdf/.asdf/installs/haskell/8.8.1/bin/stack: line 2: /asdf/.asdf/plugins/haskell/stack/stack: No such file or directory
The command '/bin/bash -l -c asdf-install-toolset haskell' returned a non-zero code: 1

Tag Docker images with asdf version

First of all, thank you for providing Docker images for asdf! This really helps a lot.

Now to my feature request: Currently, the images always use the latest version of asdf. However, I would like to protect myself against breaking changes, so it would be nice if one could specify the asdf version in the Docker image tag.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.