Skip to content

Commit 48767ad

Browse files
committed
docker: rename docker to dockerfiles
Since python3.3 python will not only import files with __init__.py, but instead also imports directory trees which contain a single python file. Therefore python running in the main repository directory will detect docker as a module and imports it. This in turn shadows the real docker module, if it is installed and breaks the tests docker import check. Move the docker files into a new dockerfiles directory which does not shadow the module name. Signed-off-by: Rouven Czerwinski <[email protected]>
1 parent 34ced0c commit 48767ad

20 files changed

+18
-18
lines changed

.github/workflows/docker.yml

+3-3
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,9 @@ jobs:
1616
password: ${{ secrets.DOCKERHUB_TOKEN }}
1717
- name: Build docker image
1818
run: |
19-
./docker/build.sh
20-
docker-compose -f docker/staging/docker-compose.yml up --exit-code-from client client
21-
docker-compose -f docker/staging/docker-compose.yml down
19+
./dockerfiles/build.sh
20+
docker-compose -f dockerfiles/staging/docker-compose.yml up --exit-code-from client client
21+
docker-compose -f dockerfiles/staging/docker-compose.yml down
2222
docker images
2323
docker tag labgrid-client ${{ secrets.DOCKERHUB_PREFIX }}client
2424
docker tag labgrid-exporter ${{ secrets.DOCKERHUB_PREFIX }}exporter

.github/workflows/unit-tests.yml

+3-3
Original file line numberDiff line numberDiff line change
@@ -67,9 +67,9 @@ jobs:
6767
- uses: actions/checkout@v2
6868
- name: Build docker images
6969
run: |
70-
./docker/build.sh
71-
docker-compose -f docker/staging/docker-compose.yml up --exit-code-from client client
72-
docker-compose -f docker/staging/docker-compose.yml down
70+
./dockerfiles/build.sh
71+
docker-compose -f dockerfiles/staging/docker-compose.yml up --exit-code-from client client
72+
docker-compose -f dockerfiles/staging/docker-compose.yml down
7373
- name: Show docker images
7474
run: |
7575
docker images

.gitignore

+2-2
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,6 @@
1717
/dist
1818
/.pytest_cache/
1919
/htmlcov/
20-
/docker/staging/crossbar/*
21-
!/docker/staging/crossbar/places_example.yaml
20+
/dockerfiles/staging/crossbar/*
21+
!/dockerfiles/staging/crossbar/places_example.yaml
2222
/.idea

.travis.yml

+3-3
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,9 @@ matrix:
3737
services:
3838
- docker
3939
script:
40-
- ./docker/build.sh
41-
- docker-compose -f docker/staging/docker-compose.yml up --exit-code-from client client
42-
- docker-compose -f docker/staging/docker-compose.yml down
40+
- ./dockerfiles/build.sh
41+
- docker-compose -f dockerfiles/staging/docker-compose.yml up --exit-code-from client client
42+
- docker-compose -f dockerfiles/staging/docker-compose.yml down
4343
- if [ "$TRAVIS_PULL_REQUEST" = "false" ] && [ "$TRAVIS_BRANCH" = "master" ] && [ "$DOCKER_USERNAME" != "" ] && [ "$DOCKER_TOKEN" != "" ]; then
4444
echo "$DOCKER_TOKEN" | docker login -u "$DOCKER_USERNAME" --password-stdin;
4545
docker images;

CODEOWNERS

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
/docker/ @krevsbech
1+
/dockerfiles/ @krevsbech

docker/README.rst dockerfiles/README.rst

+4-4
Original file line numberDiff line numberDiff line change
@@ -22,15 +22,15 @@ Example showing how to build labgrid-client image:
2222

2323
.. code-block:: bash
2424
25-
$ docker build -t labgrid-client -f docker/client/Dockerfile .
25+
$ dockerfiles build -t labgrid-client -f dockerfiles/client/Dockerfilesfile .
2626
2727
You can also choose to build all 3 images,
2828
with the included script
2929
(which also must be run from the root of this repository):
3030

3131
.. code-block:: bash
3232
33-
$ ./docker/build.sh
33+
$ ./dockerfiles/build.sh
3434
3535
3636
Usage
@@ -119,13 +119,13 @@ To use the staging environment to conduct a smoke test first build the images as
119119

120120
.. code-block:: bash
121121
122-
$ ./docker/build.sh
122+
$ ./dockerfiles/build.sh
123123
124124
Then use docker compose to start all services except the client:
125125

126126
.. code-block:: bash
127127
128-
$ cd docker/staging
128+
$ cd dockerfiles/staging
129129
$ CURRENT_UID=$(id -u):$(id -g) docker-compose up -d coordinator exporter dut
130130
131131
To run the smoke test just run the client:
File renamed without changes.

docker/build.sh dockerfiles/build.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,5 @@
33
set -ex
44

55
for dir in base client exporter coordinator; do
6-
docker build -t labgrid-${dir} -f docker/${dir}/Dockerfile .
6+
docker build -t labgrid-${dir} -f dockerfiles/${dir}/Dockerfile .
77
done
File renamed without changes.
File renamed without changes.

docker/exporter/Dockerfile dockerfiles/exporter/Dockerfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
FROM labgrid-base
22

3-
COPY docker/exporter/entrypoint.sh /entrypoint.sh
3+
COPY dockerfiles/exporter/entrypoint.sh /entrypoint.sh
44

55
RUN set -e ;\
66
cd /opt/labgrid ;\
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)