Commit fd9716a6 authored by Sebastian Neuser's avatar Sebastian Neuser

Add Dockerfile and container startup helper script

parent 3928b9c4
Pipeline #664 failed with stages
in 1 second
FROM ubuntu:xenial
# Install build dependencies
RUN apt-get update
RUN apt-get install -y --no-install-recommends autoconf automake bison++ build-essential build-essential ca-certificates dirmngr flex-old git libboost-all-dev libusb-dev libusb-1.0-0-dev libwxgtk3.0-dev vim wget
RUN apt-get clean
# Create bobdude user and homedir
RUN useradd -mU bobdude
USER bobdude
WORKDIR /home/bobdude
# Get and compile AVRdude (dependency for Bobdude)
RUN wget
RUN wget
RUN gpg --keyserver hkp:// --recv-keys 5E84F980C3CAFD4BB5841070F48CA81B69A85873
RUN gpg --verify avrdude-6.3.tar.gz.sig avrdude-6.3.tar.gz
RUN tar -xzf avrdude-6.3.tar.gz
WORKDIR /home/bobdude/avrdude-6.3
RUN ./configure && make
USER root
RUN make install
RUN ldconfig
# Get and compile Bobdude itself
USER bobdude
WORKDIR /home/bobdude
RUN git clone
WORKDIR /home/bobdude/bobdude/src
RUN autoreconf -i && ./configure && make
USER root
RUN make install
VOLUME /home/bobdude/programs
WORKDIR /home/bobdude/programs
CMD bobdude
# Starts bobdude in a docker container
# Parse and check command line parameters
if [ -z "$TTY" -o -z "$DIR" ]; then
SCRIPT_NAME=`basename $0`
echo "usage: $SCRIPT_NAME <tty> <dir>"
echo " tty absolute path to the programmer device"
echo " dir absolute path to a shared folder containing .bob3 files"
echo "examples:"
echo " $SCRIPT_NAME /dev/ttyACM0 /tmp/bob3"
echo " $SCRIPT_NAME /dev/ttyUSB0 \$HOME/bob3"
# Build the docker image if necessary
docker image ls | grep bobdude >/dev/null || docker build -t bobdude .
# Allow local connections to X server
xhost +local:
# Run docker container
docker run --rm \
--device $TTY \
--volume $PWD/$DIR:/home/bobdude/programs \
--volume /tmp/.X11-unix:/tmp/.X11-unix \
--name bobdude \
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment