Skip to content

Commit af6cf8b

Browse files
committed
First image, with only g++ 9.3.0 and make.
1 parent f7a36e8 commit af6cf8b

File tree

6 files changed

+51
-0
lines changed

6 files changed

+51
-0
lines changed

docker/Dockerfile

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
2+
# Version 1
3+
FROM gcc:9.3.0
4+
5+
# Ensure use of bash
6+
SHELL ["/bin/bash","-c"]
7+
8+
# timezone
9+
ENV TZ=Europe/Paris
10+
11+
# aptget : so to avoid debconf interactive questions
12+
#RUN echo 'debconf debconf/frontend select Noninteractive' | debconf-set-selections
13+
#ARG DEBIAN_FRONTEND=noninteractive
14+
15+
# Installations apt-get
16+
RUN apt-get update \
17+
&& apt-get install -y apt-utils \
18+
&& apt-get install -y make \
19+
&& rm -rf /var/lib/apt/lists/*
20+
21+
# update libraries cache
22+
#RUN ldconfig
23+
24+
# start a shell by default
25+
CMD bash
26+

docker/README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
* build.sh : apply the Dokerfile recipe, building an image whose name is taken from `name.txt`.
2+
* push.sh : push the image `name.txt` to the registry
3+
* run.sh : start a container from the image `name.txt`, and run the command given as arguments. The current directory is mounted as `/work`, and this is where the command is executed.

docker/build.sh

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
#!/bin/bash
2+
3+
SCRIPT_NAME=${BASH_SOURCE[0]}
4+
SCRIPT_DIR=`dirname ${SCRIPT_NAME}`
5+
cd ${SCRIPT_DIR}
6+
7+
docker build -f Dockerfile -t `cat name.txt` .
8+
# --force-rm --no-cache

docker/name.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
gitlab-registry.cern.ch/sponce/cpluspluscourse:v1

docker/push.sh

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
#!/bin/bash
2+
3+
SCRIPT_NAME=${BASH_SOURCE[0]}
4+
SCRIPT_DIR=`dirname ${SCRIPT_NAME}`
5+
6+
docker push `cat ${SCRIPT_DIR}/name.txt`

docker/run.sh

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
#!/bin/bash
2+
3+
SCRIPT_NAME=${BASH_SOURCE[0]}
4+
SCRIPT_DIR=`dirname ${SCRIPT_NAME}`
5+
6+
docker run -it --rm -v $PWD:/work -w /work `cat ${SCRIPT_DIR}/name.txt` $*
7+

0 commit comments

Comments
 (0)