0

I am getting an error while installing kotlin in ubuntu 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 apt-get install -y unzip
RUN apt-get install -y zip
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"
RUN sdk install kotlin

Getting error

Step 10/35 : RUN sdk install kotlin
---> Running in 9282af532681
/bin/sh: sdk: command not found
ERROR: Service 'myproject' failed to build: The command '/bin/sh -c sdk install kotlin' returned a non-zero code: 127

1 Answer 1

4
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 apt-get install -y unzip
RUN apt-get install -y zip
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" && sdk install kotlin

Each RUN have their own "session". So RUN sdk install kotlin will not know about previous source command.


Multiple RUN is not optimal: each RUN will create a layer.


Looks like you want to create docker image with Kotlin JVM. Then you need standard openjdk:8-jdk (Or what version you want) and then just put there your jar file.

Sign up to request clarification or add additional context in comments.

2 Comments

Thanks for reply, i am trying to install all programming languages in one docker image for my project. I want to install kotlin in ubantu image.
Usually docker used to run one process. (devops.stackexchange.com/questions/447/…). Consider to use one container for one process/application. Then you could use existing containers with particular languages. I advise you to pay attention to containers based on alpine Linux they are small and fast.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.