forked from jason790/opt-cpp-backend
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Dockerfile
36 lines (30 loc) · 1.27 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
# to build:
# docker build -t="pgbovine/opt-cpp-backend:v1" .
#
# to test:
# docker run -t -i --rm --user=netuser --net=none --cap-drop all pgbovine/opt-cpp-backend:v1 bash
#
# remember --rm or else stale old containers will be left around!
# use "docker ps -a" to see all containers
# don't use 'latest' tag since that might change
FROM ubuntu:14.04.1
MAINTAINER Philip Guo <[email protected]>
# if apt-get doesn't work, then follow these instructions:
# http://stackoverflow.com/questions/24991136/docker-build-could-not-resolve-archive-ubuntu-com-apt-get-fails-to-install-a
# Uncomment the following line in /etc/default/docker DOCKER_OPTS="--dns 8.8.8.8 --dns 8.8.4.4"
# Restart the Docker service sudo service docker restart
#
# to get gcc and g++, Valgrind needs libc6-dbg apparently
RUN apt-get update && apt-get install -y \
build-essential \
autotools-dev \
automake \
libc6-dbg \
python
RUN mkdir /tmp/opt-cpp-backend
ADD . /tmp/opt-cpp-backend
# we need to compile Valgrind from scratch within the container (hence
# 'make clean' first) to make it work from within the container, ergh
RUN cd /tmp/opt-cpp-backend/valgrind-3.11.0 && ./autogen.sh && ./configure --prefix=`pwd`/inst && make && make install
RUN useradd netuser
RUN cd /tmp/ && find . | xargs chown netuser