Skip to content

Commit 4476368

Browse files
author
Alan Christie
committed
- Adjustments for issue #33
Built-in execute command (a help command) User now has to specify WORKDIR or CMD to do real work
1 parent f85c524 commit 4476368

File tree

7 files changed

+108
-2
lines changed

7 files changed

+108
-2
lines changed

Dockerfile-obabel

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,3 +15,17 @@ RUN pip install im-pipelines-utils==2.2.* im-pipelines-utils-rdkit==1.4.*
1515

1616
USER obabel
1717

18+
# The CMD is simply to run 'execute' in the WORKDIR.
19+
# The user would normally mount a volume with their own execute
20+
# script in it and then set the WORKDIR to the directory it's in.
21+
# In its absence we just run the built-in 'execute',
22+
# which is expected to echo some descriptive/helpful text.
23+
#
24+
# The default 'execute' relies on an ENV to name the pipeline it's in,
25+
# which can be defined with the docker 'pipeline' build argument.
26+
ARG pipeline=informaticsmatters/pipelines-obabel:latest
27+
ENV PIPELINE=$pipeline
28+
WORKDIR /home/obable
29+
COPY --chown=obabel:0 execute ./
30+
RUN chmod +x ./execute
31+
CMD ["./execute"]

Dockerfile-pli

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,3 +15,17 @@ USER 1001
1515

1616
WORKDIR /home/pli
1717
ENV PLI_DIR /usr/local/pli
18+
19+
# The CMD is simply to run 'execute' in the WORKDIR.
20+
# The user would normally mount a volume with their own execute
21+
# script in it and then set the WORKDIR to the directory it's in.
22+
# In its absence we just run the built-in 'execute',
23+
# which is expected to echo some descriptive/helpful text.
24+
#
25+
# The default 'execute' relies on an ENV to name the pipeline it's in,
26+
# which can be defined with the docker 'pipeline' build argument.
27+
ARG pipeline=informaticsmatters/pli:latest
28+
ENV PIPELINE=$pipeline
29+
COPY --chown=1001:0 execute ./
30+
RUN chmod +x ./execute
31+
CMD ["./execute"]

Dockerfile-rdkit

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,3 +12,18 @@ RUN pip install -e /opt/python
1212
# And the pip packages including pipeline-utilities and im-pipelines-utils-rdkit
1313
RUN pip install molvs standardiser matplotlib \
1414
im-pipelines-utils>=2.4.5 im-pipelines-utils-rdkit>=1.5.7
15+
16+
# The CMD is simply to run 'execute' in the WORKDIR.
17+
# The user would normally mount a volume with their own execute
18+
# script in it and then set the WORKDIR to the directory it's in.
19+
# In its absence we just run the built-in 'execute',
20+
# which is expected to echo some descriptive/helpful text.
21+
#
22+
# The default 'execute' relies on an ENV to name the pipeline it's in,
23+
# which can be defined with the docker 'pipeline' build argument.
24+
ARG pipeline=informaticsmatters/rdkit_pipelines:latest
25+
ENV PIPELINE=$pipeline
26+
WORKDIR /home/rdkit
27+
COPY execute ./
28+
RUN chmod +x ./execute
29+
CMD ["./execute"]

Dockerfile-rdkit-centos

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,19 @@ COPY src/python /opt/python
1111
RUN pip install -e /opt/python
1212
# And the pip packages including pipeline-utilities and im-pipelines-utils-rdkit
1313
# NOTE: matplotlib is missing
14-
RUN pip install molvs standardiser im-pipelines-utils==2.2.* im-pipelines-utils-rdkit==1.4.*
14+
RUN pip install molvs standardiser im-pipelines-utils>=2.4.5 im-pipelines-utils-rdkit>=1.5.7
15+
16+
# The CMD is simply to run 'execute' in the WORKDIR.
17+
# The user would normally mount a volume with their own execute
18+
# script in it and then set the WORKDIR to the directory it's in.
19+
# In its absence we just run the built-in 'execute',
20+
# which is expected to echo some descriptive/helpful text.
21+
#
22+
# The default 'execute' relies on an ENV to name the pipeline it's in,
23+
# which can be defined with the docker 'pipeline' build argument.
24+
ARG pipeline=informaticsmatters/rdkit_pipelines:latest
25+
ENV PIPELINE=$pipeline
26+
WORKDIR /home/rdkit
27+
COPY execute ./
28+
RUN chmod +x ./execute
29+
CMD ["./execute"]

Dockerfile-smog

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,5 +20,17 @@ ARG USERID=1001
2020
RUN useradd -u $USERID -g 0 -m smog
2121
USER $USERID
2222

23-
23+
# The CMD is simply to run 'execute' in the WORKDIR.
24+
# The user would normally mount a volume with their own execute
25+
# script in it and then set the WORKDIR to the directory it's in.
26+
# In its absence we just run the built-in 'execute',
27+
# which is expected to echo some descriptive/helpful text.
28+
#
29+
# The default 'execute' relies on an ENV to name the pipeline it's in,
30+
# which can be defined with the docker 'pipeline' build argument.
31+
ARG pipeline=informaticsmatters/smog:latest
32+
ENV PIPELINE=$pipeline
2433
WORKDIR /home/smog
34+
COPY --chown=smog:0 execute ./
35+
RUN chmod +x ./execute
36+
CMD ["./execute"]

build.gradle

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ task buildPipelinesImage(type: DockerBuildImage) {
6464
dockerFile = file('Dockerfile-rdkit')
6565
inputDir = file('.')
6666
tag = "informaticsmatters/rdkit_${pipeline}:latest"
67+
buildArgs = ['pipeline':"informaticsmatters/rdkit_${pipeline}:latest"]
6768
}
6869

6970
task buildPliImage(type: DockerBuildImage) {
@@ -73,6 +74,7 @@ task buildPliImage(type: DockerBuildImage) {
7374
dockerFile = file('Dockerfile-pli')
7475
inputDir = file('.')
7576
tag = "informaticsmatters/pli:latest"
77+
buildArgs = ['pipeline':"informaticsmatters/pli:latest"]
7678
}
7779

7880
task buildSmogImage(type: DockerBuildImage) {
@@ -82,6 +84,7 @@ task buildSmogImage(type: DockerBuildImage) {
8284
dockerFile = file('Dockerfile-smog')
8385
inputDir = file('.')
8486
tag = "informaticsmatters/smog:latest"
87+
buildArgs = ['pipeline':"informaticsmatters/smog:latest"]
8588
}
8689

8790
task buildSdPosterImage(type: DockerBuildImage) {
@@ -99,6 +102,7 @@ task buildObabelImage(type: DockerBuildImage) {
99102
dockerFile = file('Dockerfile-obabel')
100103
inputDir = file('.')
101104
tag = "informaticsmatters/pipelines-obabel:latest"
105+
buildArgs = ['pipeline':"informaticsmatters/pipelines-obabel:latest"]
102106
}
103107

104108
task buildDockerImages() {

execute

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
#!/usr/bin/bash
2+
3+
echo
4+
echo "PIPELINES (RDKit)"
5+
echo "-----------------"
6+
echo "You have just run the built-in 'execute' command. Congratulations!"
7+
echo ""
8+
echo "In order to use this container productively you need to provide your own"
9+
echo "'execute' script or command and any corresponding data files."
10+
echo ""
11+
echo "You could mount a volume into this container that contains an executable"
12+
echo "file named 'execute', which contains the command you wish to run,"
13+
echo "and also include any additional data files. When you run the container,"
14+
echo "adjust the default container WORKDIR by using the docker '-w' option,"
15+
echo "specifying the mounted path of the volume as its value. As an example,"
16+
echo "if you've placed an 'execute' and its data in the current working"
17+
echo "directory you could run the container like this: -"
18+
echo ""
19+
echo " $ docker run --rm \\"
20+
echo " -v \$PWD:/squonk/work/docker \\"
21+
echo " -w=\"/squonk/work/docker\" \\"
22+
echo " $PIPELINE"
23+
echo ""
24+
echo "Alternatively you can run interactive commands by over-riding the"
25+
echo "built-in container 'CMD' (which is './execute'). To enter the"
26+
echo "container's shell (bash) using the default 'WORKDIR' you can run: -"
27+
echo ""
28+
echo " $ docker run --rm \\"
29+
echo " -it \\"
30+
echo " $PIPELINE \\"
31+
echo " bash"
32+
echo

0 commit comments

Comments
 (0)