Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Install sdkman in docker image

Getting error while installing SDKMAN! in Ubuntu 16.04 docker image.

FROM ubuntu:16.04
RUN apt-get update
RUN rm /bin/sh && ln -s /bin/bash /bin/sh
RUN apt-get -qq -y install curl
RUN curl -s https://get.sdkman.io | bash
RUN chmod a+x "$HOME/.sdkman/bin/sdkman-init.sh"
RUN source "$HOME/.sdkman/bin/sdkman-init.sh"
like image 285
trinath Avatar asked Apr 18 '26 10:04

trinath


1 Answers

This Dockerfile seems to work with versions current as of February 2023:

FROM ubuntu:22.04 
RUN apt-get update && apt-get install -y curl zip unzip
RUN curl -s "https://get.sdkman.io" | bash

# this SHELL command is needed to allow using source
SHELL ["/bin/bash", "-c"]    

# seems you need to put 'sdk install...'' lines in same RUN command as 'source...'.
RUN source "/root/.sdkman/bin/sdkman-init.sh"   \
                && sdk install java 19.0.2-tem  \
                && sdk install sbt 1.8.2        \
                && sdk install scala 2.13.10

like image 72
thund Avatar answered Apr 21 '26 21:04

thund



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!