Skip to content
Draft
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 Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
FROM ubuntu:14.04 AS base

RUN DEBIAN_FRONTEND=noninteractive apt-get update

FROM base AS pybuild

# Use a substitute from https://www.gnu.org/prep/ftp.html for faster downloading
ARG GNUFTP_BASEURL=http://ftp.gnu.org/gnu/

WORKDIR /dockerbuild

RUN DEBIAN_FRONTEND=noninteractive apt-get install -y wget python2.7

COPY waf wscript /dockerbuild/

# Run the waf command so that it gets bootstrapped
RUN python2.7 ./waf --version

# Install required APT packages
RUN python2.7 ./waf download
RUN python2.7 ./waf configure

# Pre-download GDB (gives better progress bar than wscript)
WORKDIR /dockerbuild/build
RUN wget "${GNUFTP_BASEURL}gdb/gdb-7.11.tar.gz" &&\
echo "9382f5534aa0754169e1e09b5f1a3b77d1fa8c59c1e57617e06af37cb29c669a gdb-7.11.tar.gz" | sha256sum -c -

WORKDIR /dockerbuild

# Run the GDB build. It uses --with-python flags so may well need to be done in
# the same container as the python install
RUN python2.7 ./waf build_gdb

# Build everything else
RUN python2.7 ./waf build

# ENTRYPOINT python2.7 gui/initialize.py
40 changes: 39 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,4 +59,42 @@ or use the attached launch script
```

You can try the attached example programs (they are placed in
`build/examples` after build).
`build/examples` after build).

Docker
======

A Dockerfile has been put together based on Ubuntu 14.04 from when the project
was built. It doesn't copy the whole app in, assuming that the repo will be
bind-mounted in so the code can still be edited.

The project can be run inside a Docker container but with the host UI, by
forwarding in an X11 UNIX socket - i.e. bind mounting the socket with
`-v /tmp/.X11-unix:/tmp/.X11-unix`.

### Example Docker usage:
```
docker build -t devi:dev .
docker run --rm -v /tmp/.X11-unix:/tmp/.X11-unix -v ./:/repo -e NO_AT_BRIDGE=1 -e DISPLAY=unix:0 -w /repo devi:dev python2.7 gui/initialize.py
```

### Notes on Docker setup

The processes under Docker probably won't have permission to use the socket by
default, so you may need to run the following from the host to allow them to
connect:

```
xhost +local:docker
```

GTK may warn about not being able to access the system accessibility bus:

```
** (initialize.py:80453): WARNING **: Couldn't connect to accessibility bus: Failed to connect to socket /run/user/1000/at-spi/bus: No such file or directory
```

This can be avoided by running the app with `NO_AT_BRIDGE=1` set as an environment variable.


More info on X11 in Docker: https://stackoverflow.com/questions/24095968/docker-for-gui-based-environments
2 changes: 1 addition & 1 deletion debugger/mi/communicator.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
from debugger.enums import ProcessState
from debugger.mi.parser import Parser

GDB_PATH = util.get_root_path("build/gdb-build/gdb")
GDB_PATH = os.environ.get('DEVI_GDB_PATH', util.get_root_path("build/gdb-build/gdb"))

if not os.path.isfile(GDB_PATH):
raise BaseException(
Expand Down