diff --git a/.dockerignore b/.dockerignore index 41601808ac76b718f61e864b2712112dddeedc4f..91445b94f5921ddc8269189c6eda60e8ddd65531 100644 --- a/.dockerignore +++ b/.dockerignore @@ -1,3 +1,2 @@ -.git/ -README* -*.swp +* +!entrypoint diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml new file mode 100644 index 0000000000000000000000000000000000000000..7054b39a18b30494f5e09efdb613a77660f36bcc --- /dev/null +++ b/.gitlab-ci.yml @@ -0,0 +1,22 @@ +--- +include: + - project: shore/ci-templates + file: templates/pre-commit.yml + - project: shore/ci-templates + file: templates/docker.yml + +stages: + - test + - build + - deploy + +variables: + IMAGE: resolver + +build: + extends: .docker-build-shore + tags: [ns4.shore.co.il] + +push: + extends: .docker-push-shore + tags: [ns4.shore.co.il] diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml new file mode 100644 index 0000000000000000000000000000000000000000..13d68fd1fc7fdca9e758d5db887f1b23ee812b77 --- /dev/null +++ b/.pre-commit-config.yaml @@ -0,0 +1,48 @@ +--- +repos: + - repo: https://github.com/pre-commit/pre-commit-hooks.git + rev: v3.4.0 + hooks: + - id: check-added-large-files + - id: check-executables-have-shebangs + - id: check-merge-conflict + - id: check-symlinks + - id: trailing-whitespace + + - repo: https://github.com/Yelp/detect-secrets + rev: v0.14.3 + hooks: + - id: detect-secrets + + - repo: https://github.com/adrienverge/yamllint + rev: v1.25.0 + hooks: + - id: yamllint + + - repo: https://github.com/amperser/proselint/ + rev: 0.10.2 + hooks: + - id: proselint + types: [plain-text] + exclude: LICENSE + + - repo: https://github.com/executablebooks/mdformat.git + rev: 0.5.3 + hooks: + - id: mdformat + + - repo: https://git.shore.co.il/nimrod/shell-pre-commit.git + rev: v0.6.0 + hooks: + - id: shell-lint + + - repo: https://github.com/shellcheck-py/shellcheck-py.git + rev: v0.7.1.1 + hooks: + - id: shellcheck + + - repo: https://git.shore.co.il/nimrod/docker-pre-commit.git/ + rev: v0.3.0 + hooks: + - id: hadolint + - id: docker-compose diff --git a/Dockerfile b/Dockerfile index c6369c4af4484bbfab23cdcaf82923b5515c21f7..de9f8467270be37b492d9fad2823d03f2a68ff0e 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,5 @@ -FROM alpine:latest +FROM alpine:3.13 +# hadolint ignore=DL3018 RUN echo '@testing http://dl-cdn.alpinelinux.org/alpine/edge/testing' >> /etc/apk/repositories && \ echo '@community http://dl-cdn.alpinelinux.org/alpine/edge/community' >> /etc/apk/repositories && \ apk add --update --no-cache \ diff --git a/LICENSE.txt b/LICENSE.txt new file mode 100644 index 0000000000000000000000000000000000000000..a9e1ecf86d977837e2e7451560a310efb1af0937 --- /dev/null +++ b/LICENSE.txt @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2021 Adar Nimrod + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/README.md b/README.md index cff10ad7df4a038a4f2ff5834f2bbc3014c4f4d5..ae799d2b34b47e2b2d3286e97d1d9e58fce62c27 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,23 @@ # Resolver +[](https://git.shore.co.il/nimrod/resolver/-/commits/master) + Testing DNS with a clean cache resolver. More info at https://www.shore.co.il/blog/resolver/. ## Usage - docker run --rm -it adarnimrod/resolver +``` +docker run --rm -it registry.shore.co.il/resolver +``` + +## License + +This software is licensed under the MIT license (see `LICENSE.txt`). + +## Author Information + +Nimrod Adar, [contact me](mailto:nimrod@shore.co.il) or visit my +[website](https://www.shore.co.il/). Patches are welcome via +[`git send-email`](http://git-scm.com/book/en/v2/Git-Commands-Email). The repository +is located at: <https://git.shore.co.il/explore/>. diff --git a/entrypoint b/entrypoint index 658be8223280589de533bd1d010c9ab254442603..08f93c7eb4bbe5fdd190f7433549d4b1da5c466a 100755 --- a/entrypoint +++ b/entrypoint @@ -2,4 +2,4 @@ set -eux kresd --addr '127.0.0.1' --noninteractive & echo 'nameserver 127.0.0.1' > /etc/resolv.conf -eval "exec gosu nobody:nobody $@" +eval exec gosu nobody:nobody "$@"