Skip to content

Commit

Permalink
docker: rename docker to dockerfiles
Browse files Browse the repository at this point in the history
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 <r.czerwinski@pengutronix.de>
  • Loading branch information
Emantor committed Feb 5, 2021
1 parent a47f9d0 commit 3730ebe
Show file tree
Hide file tree
Showing 20 changed files with 18 additions and 18 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ jobs:
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build docker image
run: |
./docker/build.sh
docker-compose -f docker/staging/docker-compose.yml up --exit-code-from client client
docker-compose -f docker/staging/docker-compose.yml down
./dockerfiles/build.sh
docker-compose -f dockerfiles/staging/docker-compose.yml up --exit-code-from client client
docker-compose -f dockerfiles/staging/docker-compose.yml down
docker images
docker tag labgrid-client ${{ secrets.DOCKERHUB_PREFIX }}client
docker tag labgrid-exporter ${{ secrets.DOCKERHUB_PREFIX }}exporter
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/unit-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,9 +65,9 @@ jobs:
- uses: actions/checkout@v2
- name: Build docker images
run: |
./docker/build.sh
docker-compose -f docker/staging/docker-compose.yml up --exit-code-from client client
docker-compose -f docker/staging/docker-compose.yml down
./dockerfiles/build.sh
docker-compose -f dockerfiles/staging/docker-compose.yml up --exit-code-from client client
docker-compose -f dockerfiles/staging/docker-compose.yml down
- name: Show docker images
run: |
docker images
4 changes: 2 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,6 @@
/dist
/.pytest_cache/
/htmlcov/
/docker/staging/crossbar/*
!/docker/staging/crossbar/places_example.yaml
/dockerfiles/staging/crossbar/*
!/dockerfiles/staging/crossbar/places_example.yaml
/.idea
6 changes: 3 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,9 @@ matrix:
services:
- docker
script:
- ./docker/build.sh
- docker-compose -f docker/staging/docker-compose.yml up --exit-code-from client client
- docker-compose -f docker/staging/docker-compose.yml down
- ./dockerfiles/build.sh
- docker-compose -f dockerfiles/staging/docker-compose.yml up --exit-code-from client client
- docker-compose -f dockerfiles/staging/docker-compose.yml down
- if [ "$TRAVIS_PULL_REQUEST" = "false" ] && [ "$TRAVIS_BRANCH" = "master" ] && [ "$DOCKER_USERNAME" != "" ] && [ "$DOCKER_TOKEN" != "" ]; then
echo "$DOCKER_TOKEN" | docker login -u "$DOCKER_USERNAME" --password-stdin;
docker images;
Expand Down
2 changes: 1 addition & 1 deletion CODEOWNERS
Original file line number Diff line number Diff line change
@@ -1 +1 @@
/docker/ @krevsbech
/dockerfiles/ @krevsbech
8 changes: 4 additions & 4 deletions docker/README.rst → dockerfiles/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,15 @@ Example showing how to build labgrid-client image:

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

.. code-block:: bash
$ ./docker/build.sh
$ ./dockerfiles/build.sh
Usage
Expand Down Expand Up @@ -119,13 +119,13 @@ To use the staging environment to conduct a smoke test first build the images as

.. code-block:: bash
$ ./docker/build.sh
$ ./dockerfiles/build.sh
Then use docker compose to start all services except the client:

.. code-block:: bash
$ cd docker/staging
$ cd dockerfiles/staging
$ CURRENT_UID=$(id -u):$(id -g) docker-compose up -d coordinator exporter dut
To run the smoke test just run the client:
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion docker/build.sh → dockerfiles/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@
set -ex

for dir in base client exporter coordinator; do
docker build -t labgrid-${dir} -f docker/${dir}/Dockerfile .
docker build -t labgrid-${dir} -f dockerfiles/${dir}/Dockerfile .
done
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
FROM labgrid-base

COPY docker/exporter/entrypoint.sh /entrypoint.sh
COPY dockerfiles/exporter/entrypoint.sh /entrypoint.sh

RUN set -e ;\
cd /opt/labgrid ;\
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit 3730ebe

Please sign in to comment.