Skip to content
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

Dockerfile #19

Closed
mgns opened this issue Jul 22, 2015 · 8 comments
Closed

Dockerfile #19

mgns opened this issue Jul 22, 2015 · 8 comments
Assignees

Comments

@mgns
Copy link

mgns commented Jul 22, 2015

I have trouble installing the ldf-server due to dependencies. Being not proficient with NodeJS the error reports and dependencies just look unfamiliar when setting up the environment. It would be helpful to have a Dockerfile. My approach does not work fully:

FROM ubuntu:14.10

RUN apt-get install -y software-properties-common
RUN apt-add-repository ppa:chris-lea/node.js
RUN apt-get update
RUN apt-get install -y nodejs
RUN apt-get install -y python

#RUN npm install hdt

# Bundle app source
ADD . /src

# Install app dependencies
RUN cd /src; npm install -g ldf-server

EXPOSE 5000

WORKDIR /src
CMD ldf-server config.json 5000 4
@RubenVerborgh
Copy link
Member

A Dockerfile is indeed something that was on my feature list.

Could you explain what does not work with your approach?

@mgns
Copy link
Author

mgns commented Jul 22, 2015

make, g++ and git was missing. Now it works! Reading error messages entirely sometimes helps.

FROM ubuntu:14.10

RUN apt-get install -y software-properties-common
RUN apt-add-repository ppa:chris-lea/node.js
RUN apt-get update
RUN apt-get install -y nodejs
RUN apt-get install -y python make g++ git

# Bundle app source
ADD . /src

# Install app dependencies
RUN cd /src; npm install -g ldf-server

EXPOSE 5000

WORKDIR /src
CMD ldf-server config.json 5000 4

@RubenVerborgh
Copy link
Member

Alright, thanks! Now we just need to find a way to make adding datasets easy.

@mgns
Copy link
Author

mgns commented Jul 22, 2015

I preferred using the HDT approach and mounted a local folder to /src/data on startup. That allows to reuse the docker image, just select the data folder and final port on startup. You can also put the config.json into that data folder:

$ docker build -t ldfragments .
$ docker run -v /home/magnus/data:/src/data -p 5000:5000 ldfragments

@RubenVerborgh RubenVerborgh self-assigned this Oct 22, 2015
@barthanssens
Copy link
Contributor

Current docker file is a good start, but does create a rather large image.

FYI, I'm experimenting a little bit, and using node:4-alpine won't work (at least, not when HDT module is required, because the hdt library needs to be build, just including and removing g++/python does not work either because of a missing symbol/library... working on it)

@thadguidry
Copy link

thadguidry commented May 10, 2017

@barthanssens Alpine doesn't use glibc, but instead musl libc. This makes it smaller, but you might run into build problems if glibc is necessary for some of the libraries. Remember, Alpine was created primarily to support running on small embedded devices. Its not always a good first choice for larger applications. But Docker has now officially embraced it. Regardless, you should be able to "get regular stuff working"
https://alpinelinux.org/posts/Alpine-Linux-has-switched-to-musl-libc.html
https://wiki.alpinelinux.org/wiki/How_to_get_regular_stuff_working
https://wiki.alpinelinux.org/wiki/Upgrading_Alpine

@RubenVerborgh
Copy link
Member

I've reassigned to @rubensworks, as he created the Dockerfile we currently have. We should probably close this issue and create a new one for the others.

@rubensworks
Copy link
Member

Closing this issue as the server has a Dockerfile and is available on the Docker hub.

The issue about the Docker image size will be continued in #40.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants