Skip to content

Commit

Permalink
Update Docker scripts.
Browse files Browse the repository at this point in the history
  • Loading branch information
gfour committed Dec 21, 2021
1 parent 854783a commit a8efd13
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 16 deletions.
22 changes: 17 additions & 5 deletions docs/docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
FROM ubuntu:bionic
FROM ubuntu:focal

USER root

## package update
RUN apt-get update

## Set "Noninteractive" mode during Docker build
RUN echo 'debconf debconf/frontend select Noninteractive' | debconf-set-selections
## locales: Doop may hang for non-UTF8 locales
RUN apt-get install -y apt-utils busybox nano
RUN apt-get install -y apt-utils busybox nano libterm-readline-perl-perl
# apt-utils installation should happen before locales installation
RUN apt-get install -y locales
RUN sed -i -e 's/# en_US.UTF-8 UTF-8/en_US.UTF-8 UTF-8/' /etc/locale.gen
Expand All @@ -22,9 +24,16 @@ RUN dpkg-reconfigure --frontend=noninteractive locales
# RUN dpkg-reconfigure -f noninteractive tzdata

## Souffle
RUN apt-get install -y cpp autoconf automake bison build-essential clang doxygen flex g++ gdb git libncurses5-dev libtool libsqlite3-dev make mcpp python3 sqlite zlib1g-dev wget curl
RUN apt-get install -y cmake cpp autoconf automake bison build-essential clang doxygen flex g++ gdb git libncurses5-dev libtool libsqlite3-dev make mcpp python3 sqlite unzip zlib1g-dev wget curl
# RUN mkdir /souffle && wget https://github.com/souffle-lang/souffle/releases/download/1.5.1/souffle_1.5.1-1_amd64.deb -O /souffle/souffle_1.5.1-1_amd64.deb && apt-get install /souffle/souffle_1.5.1-1_amd64.deb
RUN mkdir /souffle && wget https://github.com/souffle-lang/souffle/releases/download/2.0.2/souffle_2.0.2-1_amd64.deb -O /souffle/souffle_2.0.2-1_amd64.deb && apt-get install /souffle/souffle_2.0.2-1_amd64.deb
# RUN mkdir /souffle && wget https://github.com/souffle-lang/souffle/releases/download/2.0.2/souffle_2.0.2-1_amd64.deb -O /souffle/souffle_2.0.2-1_amd64.deb && apt-get install /souffle/souffle_2.0.2-1_amd64.deb
# Install Souffle from sources
RUN mkdir /souffle && wget https://github.com/souffle-lang/souffle/archive/refs/tags/2.1.zip -O /souffle/2.1.zip && cd /souffle && unzip 2.1.zip
RUN ls /souffle
RUN ls /souffle/souffle-2.1
RUN cmake --version
RUN apt-get install -y bash-completion lsb-release
RUN cd /souffle/souffle-2.1 && mkdir build && cmake -S . -B build && cmake --build build -j --target install

## ddlog
## Rust (binary release)
Expand All @@ -46,8 +55,11 @@ ENV DOOP_PLATFORMS_LIB=/doop-benchmarks
ENV DOOP_CACHE=/data/cache
ENV DOOP_OUT=/data/out
RUN mkdir /doop
ARG DOOP_VERSION=doop-4.24.2
ARG DOOP_VERSION=doop-4.24.9
COPY $DOOP_VERSION.zip /doop/$DOOP_VERSION.zip
RUN cd /doop && unzip $DOOP_VERSION.zip
ENV DOOP_HOME=/doop/$DOOP_VERSION
ENV PATH="$PATH:$DOOP_HOME/bin"

## Revert to "Dialog" mode after Docker build
RUN echo 'debconf debconf/frontend select Dialog' | debconf-set-selections
20 changes: 10 additions & 10 deletions docs/docker/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,21 +11,21 @@ To create a Docker container for Doop:
```

(2) Find the resulting archive, e.g.,
"build/distributions/doop-4.24.2.zip" and copy it to the Dockerfile
"build/distributions/doop-4.24.9.zip" and copy it to the Dockerfile
directory.

```
cp build/distributions/doop-4.24.2.zip docs/docker/
cp build/distributions/doop-4.24.9.zip docs/docker/
```

(3) Edit the Dockerfile and set DOOP_VERSION to the base name of the
archive (omit the file extension).
(3) Edit file `docs/docker/Dockerfile` and set DOOP_VERSION to the
base name of the archive (omit the file extension).

(4) Run:

```
cd docs/docker
docker build -t doop-4.24.2 . --no-cache
docker build -t doop-4.24.9 . --no-cache
```

(5) Create a local directory for Doop's cache/out directories (needed
Expand All @@ -43,7 +43,7 @@ the container (if `realpath` is not available, replace with absolute
path of doop-data):

```
docker container create --name doop_container -v $(realpath ./doop-data):/data -t doop-4.24.2
docker container create --name doop_container -v $(realpath ./doop-data):/data -t doop-4.24.9
```

Start the container:
Expand All @@ -62,17 +62,17 @@ relations:

```
root@af6ca7193b3d:/# cd $DOOP_HOME
root@af6ca7193b3d:/doop/doop-4.24.2# bin/doop -i /path/to/app.jar -a context-insensitive --id test
root@af6ca7193b3d:/doop/doop-4.24.2# ls /data/out/context-insensitive/test/database/
root@af6ca7193b3d:/doop/doop-4.24.9# bin/doop -i /path/to/app.jar -a context-insensitive --id test
root@af6ca7193b3d:/doop/doop-4.24.9# ls /data/out/context-insensitive/test/database/
```

## Publishing in Docker Hub ##

The following commands publish the Doop image to the [gfour/doop repository](https://hub.docker.com/r/gfour/doop) in Docker Hub:

```
docker tag doop-4.24.2 gfour/doop:4.24.2
docker push gfour/doop:4.24.2
docker tag doop-4.24.9 gfour/doop:4.24.9
docker push gfour/doop:4.24.9
```

## Notes ##
Expand Down
2 changes: 1 addition & 1 deletion docs/docker/docker-build-and-push.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

set -e

DOOP_VERSION=4.24.2
DOOP_VERSION=4.24.9
DOOP_ID=doop-${DOOP_VERSION}

echo "Building ${DOOP_ID}..."
Expand Down

0 comments on commit a8efd13

Please sign in to comment.