Skip to content

Commit

Permalink
Merge pull request #8 from AlgoLab/issue-#7
Browse files Browse the repository at this point in the history
Issue #7
  • Loading branch information
ldenti authored Jun 22, 2020
2 parents 98e1ace + 6e12649 commit b38b8aa
Show file tree
Hide file tree
Showing 3 changed files with 68 additions and 29 deletions.
53 changes: 53 additions & 0 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
FROM ubuntu:18.04

## for apt to be noninteractive
ENV DEBIAN_FRONTEND noninteractive
ENV DEBCONF_NONINTERACTIVE_SEEN true

RUN apt update -qqy
RUN apt-get install -qqy apt-utils

RUN echo 'tzdata tzdata/Areas select Etc' | debconf-set-selections; \
echo 'tzdata tzdata/Zones/Etc select UTC' | debconf-set-selections; \
apt-get install -qqy --no-install-recommends tzdata

## preesed tzdata, update package index, upgrade packages and install needed software
RUN apt-get install -qqy \
build-essential \
ca-certificates \
cmake \
dirmngr \
git \
make \
python3 \
python3-biopython \
python3-biopython-sql \
python3-pandas \
python3-pip \
python3-pysam \
python3-setuptools \
samtools \
wget \
zlib1g-dev
RUN apt-get clean
RUN pip3 install gffutils


# Install gosu
ENV GOSU_VERSION 1.12
RUN set -eux; \
dpkgArch="$(dpkg --print-architecture | awk -F- '{ print $NF }')"; \
wget -O /usr/local/bin/gosu "https://github.com/tianon/gosu/releases/download/$GOSU_VERSION/gosu-$dpkgArch"; \
chmod +x /usr/local/bin/gosu; \
# verify that the binary works
gosu --version; \
gosu nobody true

RUN git clone --recursive https://github.com/AlgoLab/galig.git
RUN cd galig ; make prerequisites
RUN cd galig ; make

VOLUME ["/data"]
COPY asgal-docker.sh /galig/asgal-docker.sh
ENV PATH=$PATH:/galig/asgal
ENTRYPOINT ["/galig/asgal-docker.sh"]
15 changes: 15 additions & 0 deletions asgal-docker.sh → docker/asgal-docker.sh
Original file line number Diff line number Diff line change
@@ -1,9 +1,22 @@
#!/bin/bash

# Add local user
# with the same owner as /data
USER_ID=$(stat -c %u /data)
GROUP_ID=$(stat -c %g /data)

echo "Starting with UID:GID $USER_ID:$GROUP_ID"
# We create user:group with the correct uid:gid
groupadd -g "$GROUP_ID" group
useradd --shell /bin/bash -u "$USER_ID" -g group -o -c "" -m user
export HOME=/
chown --recursive "$USER_ID":"$GROUP_ID" /data

if [ -s /data/transcripts.fa ]
then
if [ -s /data/sample_2.fa ]
then
gosu user:group \
/galig/asgal --multi \
-g /data/genome.fa \
-a /data/annotation.gtf \
Expand All @@ -12,6 +25,7 @@ then
-t /data/transcripts.fa \
-o /data/output
else
gosu user:group \
/galig/asgal --multi \
-g /data/genome.fa \
-a /data/annotation.gtf \
Expand All @@ -20,6 +34,7 @@ then
-o /data/output
fi
else
gosu user:group \
/galig/asgal -g /data/genome.fa \
-a /data/annotation.gtf \
-s /data/sample_1.fa \
Expand Down
29 changes: 0 additions & 29 deletions paper/Dockerfile

This file was deleted.

0 comments on commit b38b8aa

Please sign in to comment.