Skip to content

Commit

Permalink
Add docker container (#182)
Browse files Browse the repository at this point in the history
* Add drop-in docker replacement

* Move to tool.dockerfile

* Fix config path

* Fix path

* Update tool.Dockerfile

Co-authored-by: Swen Wenzel <5111028+swenzel@users.noreply.github.com>

* Update tool.Dockerfile

Co-authored-by: Swen Wenzel <5111028+swenzel@users.noreply.github.com>

* Fixes PR comments and added build command

* Update

* Remove apt-get clean

* Little cleanup

Co-authored-by: Swen Wenzel <5111028+swenzel@users.noreply.github.com>
  • Loading branch information
hfjn and swenzel committed Apr 16, 2021
1 parent 84512af commit 58f5af8
Show file tree
Hide file tree
Showing 5 changed files with 50 additions and 2 deletions.
11 changes: 10 additions & 1 deletion .dockerignore
@@ -1,4 +1,13 @@
build/
dist/
*.egg-info/
docker-compose.yml
.env
.flake8
.gitignore
.pre-commit-config.yaml
CHANGELOG.md
docker-compose*
docker_binding.sh
*Dockerfile
LICENSE
Makefile
2 changes: 1 addition & 1 deletion Dockerfile
Expand Up @@ -30,4 +30,4 @@ COPY ./tests /esque/tests
COPY ./esque /esque/esque
ENTRYPOINT ["/bin/bash"]

CMD ["", "pytest", "tests/"]
CMD ["", "pytest", "tests/"]
3 changes: 3 additions & 0 deletions Makefile
Expand Up @@ -40,6 +40,9 @@ publish:
wheel:
@poetry build -v

build-tool-image:
@docker build -t esque -f tool.Dockerfile .

linux_release:
docker pull quay.io/pypa/manylinux2010_x86_64
docker run --rm -t -i -v `pwd`:/io quay.io/pypa/manylinux2010_x86_64 /io/make-linux-release.sh
Expand Down
11 changes: 11 additions & 0 deletions docker_binding.sh
@@ -0,0 +1,11 @@
#!/usr/bin/env bash

esque(){
docker run \
--mount type=bind,source="$(pwd)",target=/home/esque/work \
--mount type=bind,source="${HOME}/.esque/esque_config.yaml",target=/home/esque/esque_config.yaml \
--rm \
-it \
-e ESQUE_CONF_PATH=/home/esque/esque_config.yaml \
esque "${@}"
}
25 changes: 25 additions & 0 deletions tool.Dockerfile
@@ -0,0 +1,25 @@
FROM python:3.9

RUN apt-get update \
&& apt-get upgrade \
&& apt-get install --yes --no-install-recommends \
kafkacat \
vim \
&& rm -rf \
/var/lib/apt/lists/* \
/var/cache/debconf \
/tmp/* \
&& pip install -U pip \
&& pip install --pre poetry

WORKDIR /esque
COPY . /esque
RUN poetry config "virtualenvs.create" "false"
RUN poetry install

RUN useradd -ms /bin/bash esque
USER esque

WORKDIR /home/esque/work

ENTRYPOINT ["esque"]

0 comments on commit 58f5af8

Please sign in to comment.