Posts mit dem Label scala werden angezeigt. Alle Posts anzeigen
Posts mit dem Label scala werden angezeigt. Alle Posts anzeigen

Donnerstag, 12. November 2015

Easy SBT build in Docker container

When you need to build your Scala project, but have no way to install SBT on your host, you can still do it if you have Docker.

There are few ready to use container images on DockerHub. We create our own.

All we need for that is to prepare a Dockerfile:

 FROM java:latest  
 MAINTAINER Nikolay Kushin nikolay@indoo.rs  
 ENV SCALA_VERSION 2.11.7  
 ENV SBT_VERSION 0.13.9  
 ENV SBT_OPTS -Xmx2G -XX:+UseConcMarkSweepGC -XX:+CMSClassUnloadingEnabled -Xss2M -Duser.timezone=GMT  
 # install sbt  
 RUN wget https://dl.bintray.com/sbt/debian/sbt-$SBT_VERSION.deb  
 RUN dpkg -i sbt-$SBT_VERSION.deb  
 # install scala  
 RUN wget https://downloads.typesafe.com/scala/$SCALA_VERSION/scala-$SCALA_VERSION.deb  
 RUN dpkg -i scala-$SCALA_VERSION.deb  
 # fetch base dependencies  
 RUN sbt compile  
 VOLUME /src  
 WORKDIR /src  
 CMD ["sbt"]  

Our Dockerfile is relatively easy and self-explaining.

Next step is to build an image. Save Dockerfile in some folder and execute following commande in terminal:

 docker build -t sbt-docker .  

Now when the image is ready we can create container with mounted source folder, containing our Scala project and run SBT.

 docker run -it --rm -v $(pwd):/src sbt-docker sbt docker:stage  

Thats it! Enjoy!

Freitag, 10. April 2015

Mittwoch, 10. Dezember 2014

My participation in Global Hackathon

The past weekend I was lucky enough to participate in an event held by Koding (http://koding.com) titled "Global Hackathon" (https://koding.com/Hackathon).
Hackathon - is a kind of time-limited events, where participants work on projects for which in ordinary daily life there is no time as a rule. The main idea is to bring the idea to the finished prototype of the final product in the shortest possible time. Hackathon is named this way because participants can use all possible tools and ways to achieve this goal.


file-2.pngThe event was attended by 2000 teams from all around the world, selected from more than 19,000 applications. Maximum number of participants in the team was equal to 5. Many people like me was not fortunate enough to find teammates and had to work alone. 51 of the judges will find winners among completed projects and the most worthy of them will be awarded.

Sonntag, 5. Januar 2014

CloudControl - setup Scala/Play application

CloudControl (https://www.cloudcontrol.com) is a Platform as a Service solution.

You can deploy on it Java  NodeJS  PHP  Python  Ruby applications as well as a lot of Third-Party Buildpacks including Scala/Play (https://github.com/heroku/heroku-buildpack-play). Its main particularity is that it supports vertical and horizontal scaling.

The following guide explains how to deploy your application on CloudControl.

Sonntag, 15. Dezember 2013

Life after Coderetreat 2013

Last Saturday I was on Coderetreat 2013 in Vienna. There we tried to implement rules of Conway's Game of Life. During the day I've got a lot of experience in TDD, pair programming and languages I haven't used for a while. One thing I've missed was final implementation of game.

One day after the event I've tried some ideas I'd got before. I've pushed my own implementation of game in my Github repository and created an instance of server on Heroku.

Montag, 9. Dezember 2013

RPI: extending swap

Last weekend I spent some time running my Scala/Play application on Raspberry PI. I got an OutOfMemoryError and had to slightly extend swap space:

 >sudo su  
 >echo "CONF_SWAPSIZE=512" > /etc/dphys-swapfile  
 >dphys-swapfile setup  
 >dphys-swapfile swapon