-
Notifications
You must be signed in to change notification settings - Fork 96
-
Notifications
You must be signed in to change notification settings - Fork 96
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Issues in trying to make a Scala environment #170
Comments
Yes. I usually "fix" the passwd file:
But alternative is too bind a volume:
Both settings will put home of the (pseudo-) root user into the "tmp" subdir of your project directory. |
commands:
scala: !Command
container: sbt
environ: { HOME: /root }
run: ./sbt -sbt-create console Or if you want to be able to write in root commands:
scala: !Command
container: sbt
write-mode: transient-hard-link-copy
run: ./sbt -sbt-create console |
@lilianmoraru the problem is that java uses |
Thank you for your help! I tried settings $HOME, but in fact it did not help. Writing I am now almost done, I have a little issue with SSL, but I will post here a working Scala config as soon as it's ready |
A working containers:
jvm:
setup:
- !UbuntuRelease { version: 15.04 }
- !UbuntuUniverse
- !Install [openjdk-8-jre-headless, curl]
- !Sh "update-ca-certificates -f"
sbt:
setup:
- !Container jvm
- !Sh "curl -s https://raw.githubusercontent.com/paulp/sbt-extras/master/sbt > sbt"
- !Sh "chmod +x sbt"
- !Sh "sed -i '/^root/{s@/root@/work/tmp@;}' /etc/passwd"
volumes:
/tmp: !Tmpfs
size: 100Mi
mode: 0o1777
commands:
scala: !Command
container: sbt
run: ./sbt -sbt-create console
sh: !Command
container: sbt
run: bash |
@andreaferretti nice. Could I steal it to examples? Or maybe you'd like to make a pull request? |
@andreaferretti Another way I solve my issues with the certificates is to install the package - !Install [ca-certificates]
# Or only at container build
- !BuildDeps [ca-certificates] |
@tailhook Sure, use it however you prefer! If you want me to make a PR, just ask @lilianmoraru Yeah, I confirm that installing |
Closing this, as everything is working fine. The latest version I have looks like this: containers:
jvm:
setup:
- !UbuntuRelease { version: 15.04 }
- !UbuntuUniverse
- !Install [openjdk-8-jre-headless, ca-certificates]
sbt:
setup:
- !Container jvm
- !Install [curl]
- !EnsureDir /work/.home/sbt
- !Download
url: https://raw.githubusercontent.com/paulp/sbt-extras/master/sbt
path: /work/.home/sbt/sbt
mode: 0o744
- !Sh "sed -i '/^root/{s@/root@/work/.home@;}' /etc/passwd"
volumes:
/tmp: !Tmpfs
size: 100Mi
mode: 0o1777
environ:
PATH: "/work/.home/sbt:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
HOME: /work/.home
commands:
scala: !Command
container: sbt
run: sbt -sbt-create console
description: Run a scala console
sh: !Command
container: sbt
run: bash
description: Enter a shell with sbt available Thanks everyone for the help! |
By the way, a few more examples |
I am trying to make a simple container for Scala development. The usual process of installing Scala consists of
This seems a little contrived, but allows to change everything (libraries, the version of Scala, the version of SBT itself) from a simple configuration file per project. The only thing that is needed to bootstrap everything is a small script.
So, here is my tentative
vagga.yaml
:When I try to run
sbt -sbt-create
or anything that starts the bootstrap process, the sbt launcher tries to download a few jars inside/tmp
, which is why I have the temporary volume. Unfortunately, I get the following error:It probably has to do with the fact that
sbt
expects to be able to write its configuration under$HOME/.sbt
, and packages under$HOME/.ivy
. I have tried a few settings, but I was not able to make this work.Is it possible to bind the home directory in some writable dir?
The text was updated successfully, but these errors were encountered: