Skip to content
This repository has been archived by the owner on May 28, 2022. It is now read-only.

Add initial Dockerfile #486

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 37 additions & 0 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# freeseer - vga/presentation capture software
#
# Copyright (C) 2014 Free and Open Source Software Learning Centre
# http://fosslc.org
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.

# For support, questions, suggestions or any other inquiries, visit:
# http://wiki.github.com/Freeseer/freeseer/

FROM ubuntu:12.04

RUN apt-get update && apt-get upgrade -y
RUN apt-get install -y openssh-server pwgen
RUN apt-get install -y gstreamer-tools gstreamer0.10-plugins-good
RUN apt-get install -y sqlite libqt4-sql-sqlite
RUN apt-get install -y python-pip python-gst0.10 pyqt4-dev-tools python-qt4-sql python-feedparser python-httplib2 python-oauth python-simplejson
RUN pip install yapsy

ADD scripts /scripts
RUN chmod +x /scripts/*.sh

EXPOSE 22

CMD /scripts/start-sshd.sh

28 changes: 28 additions & 0 deletions docker/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
Build
=====
To build the Freeseer docker image run the following command:

<pre>sudo docker build -rm -t freeseer .</pre>


Run
===
To run the Freeseer docker image run the following command:

<pre>
sudo docker run -rm -p 3000:22 -i -t -v /home/username/git/freeseer/src:/freeseer freeseer

OR

sudo docker run -rm -p 3000:22 -i -t -privileged -v /dev/video0:/dev/video0 -v /dev/bus/usb:/dev/bus/usb -v /home/zxiiro/git/freeseer/src:/freeseer freeseer
</pre>

This will port forward the SSH port to your local port 3000 allowing you to connect to the docker image.
Use <b>ssh -X root@localhost -p 3000</b> to connect.

The paramenter <b>-v source:destination</b> will mount a local directory inside the docker image. You should use this
to mount your clone of your Freeseer repo inside the image. This will allow you to use your code from inside the image.

If you need you mount a USB webcam adding the paramenters <b>-privileged -v /dev/video0:/dev/video0 -v /dev/bus/usb:/dev/bus/usb</b>
will allow you to see your USB webcam from inside the docker container.

40 changes: 40 additions & 0 deletions docker/scripts/start-sshd.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# freeseer - vga/presentation capture software
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

shell scripts should start with a shell declaration such as:

#!/bin/bash

#
# Copyright (C) 2014 Free and Open Source Software Learning Centre
# http://fosslc.org
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.

# For support, questions, suggestions or any other inquiries, visit:
# http://wiki.github.com/Freeseer/freeseer/

echo "Generating Root Password..."
PASS=$(pwgen -s 12 1)

printf "$PASS\n$PASS" | passwd > /dev/null 2>&1

echo "---"
echo "SSH Server configured"
echo "---"
echo "Your randomly generated root password is $PASS"
echo ""
echo "To connect to the dev system run the following command:"
echo " ssh -X root@server -p <port>"
echo ""
echo "Where <port> is the port forwarded on your host."
echo ""

echo "Starting SSHD..."
mkdir /var/run/sshd
exec /usr/sbin/sshd -D