From b8812eb04628ab052f4b4c57ddf936fc67645046 Mon Sep 17 00:00:00 2001 From: Fedor Lukyanov Date: Tue, 11 Dec 2018 18:40:01 +0200 Subject: [PATCH] Initial --- .dockerignore | 7 +++++ .gitignore | 1 + .hadolint.yaml | 4 +++ 1.0.0/alpine/Dockerfile | 38 ++++++++++++++++++++++++++ 1.1-alpha/alpine/Dockerfile | 38 ++++++++++++++++++++++++++ LICENSE | 21 +++++++++++++++ README.md | 54 +++++++++++++++++++++++++++++++++++++ dobi.yaml | 42 +++++++++++++++++++++++++++++ 8 files changed, 205 insertions(+) create mode 100644 .dockerignore create mode 100644 .gitignore create mode 100644 .hadolint.yaml create mode 100644 1.0.0/alpine/Dockerfile create mode 100644 1.1-alpha/alpine/Dockerfile create mode 100644 LICENSE create mode 100644 README.md create mode 100644 dobi.yaml diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..50938f0 --- /dev/null +++ b/.dockerignore @@ -0,0 +1,7 @@ +.git +.gitignore +LICENSE +README.md +.hadolint.yaml +dobi.yaml +.dobi diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..ae2db70 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +.dobi diff --git a/.hadolint.yaml b/.hadolint.yaml new file mode 100644 index 0000000..64cadf5 --- /dev/null +++ b/.hadolint.yaml @@ -0,0 +1,4 @@ +ignored: + - DL3003 + - DL4006 + - DL3018 diff --git a/1.0.0/alpine/Dockerfile b/1.0.0/alpine/Dockerfile new file mode 100644 index 0000000..30467d0 --- /dev/null +++ b/1.0.0/alpine/Dockerfile @@ -0,0 +1,38 @@ +FROM alpine:3.8 + +LABEL version="1.0.0" \ + maintainer="sleekybadger@gmail.com" + +ENV LIBPOSTAL_VERSION="1.0.0" \ + LIBPOSTAL_DOWNLOAD_URL="https://github.com/openvenues/libpostal/archive/v1.0.0.tar.gz" \ + LIBPOSTAL_DOWNLOAD_SHA="3035af7e15b2894069753975d953fa15a86d968103913dbf8ce4b8aa26231644" + +RUN set -ex \ + \ + && apk add --no-cache --virtual .build-deps \ + curl \ + gcc \ + g++ \ + make \ + libtool \ + autoconf \ + automake \ + \ + && wget -O libpostal.tar.gz "$LIBPOSTAL_DOWNLOAD_URL" \ + && echo "$LIBPOSTAL_DOWNLOAD_SHA *libpostal.tar.gz" | sha256sum -c - \ + \ + && mkdir -p /src \ + && mkdir -p /data \ + \ + && tar -xzf libpostal.tar.gz -C /src --strip-components=1 \ + && rm libpostal.tar.gz \ + && cd /src \ + \ + && autoreconf -fi --warning=no-syntax --warning=no-portability \ + && ./configure --prefix=/usr --datadir=/data \ + \ + && make -j "$(nproc)" \ + && make install \ + \ + && apk del .build-deps \ + && rm -rf /src diff --git a/1.1-alpha/alpine/Dockerfile b/1.1-alpha/alpine/Dockerfile new file mode 100644 index 0000000..f762011 --- /dev/null +++ b/1.1-alpha/alpine/Dockerfile @@ -0,0 +1,38 @@ +FROM alpine:3.8 + +LABEL version="1.0.0" \ + maintainer="sleekybadger@gmail.com" + +ENV LIBPOSTAL_VERSION="1.1-alpha" \ + LIBPOSTAL_DOWNLOAD_URL="https://github.com/openvenues/libpostal/archive/v1.1-alpha.tar.gz" \ + LIBPOSTAL_DOWNLOAD_SHA="c8a88eed70d8c09f68e1e69bcad35cb397e6ef11b3314e18a87b314c0a5b4e3a" + +RUN set -ex \ + \ + && apk add --no-cache --virtual .build-deps \ + curl \ + gcc \ + g++ \ + make \ + libtool \ + autoconf \ + automake \ + \ + && wget -O libpostal.tar.gz "$LIBPOSTAL_DOWNLOAD_URL" \ + && echo "$LIBPOSTAL_DOWNLOAD_SHA *libpostal.tar.gz" | sha256sum -c - \ + \ + && mkdir -p /src \ + && mkdir -p /data \ + \ + && tar -xzf libpostal.tar.gz -C /src --strip-components=1 \ + && rm libpostal.tar.gz \ + && cd /src \ + \ + && autoreconf -fi --warning=no-syntax --warning=no-portability \ + && ./configure --prefix=/usr --datadir=/data \ + \ + && make -j "$(nproc)" \ + && make install \ + \ + && apk del .build-deps \ + && rm -rf /src diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..03b605a --- /dev/null +++ b/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2018 Fedor Lukyanov + +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 new file mode 100644 index 0000000..cad0fda --- /dev/null +++ b/README.md @@ -0,0 +1,54 @@ +# docker-libpostal + +Base [libpostal](https://github.com/openvenues/libpostal) Docker images built on Alpine Linux. + +Versions v1.0.0 and v1.1-alpha – built on [Alpine Linux](https://alpinelinux.org). + +All versions use [sleekybadger/libpostal](https://hub.docker.com/r/sleekybadger/libpostal) repository, +but each version aligns with the following tags: + +* `latest` `alpine` `alpine3.8` +* `1-alpine` `1-alpine3.8` `1.1-alpine` +* `1.1-alpine3.8` `1.1-alpha-alpine` `1.1-alpha-alpine3.8` + +## Table of Contents + +- [Example](#example) +- [License](#license) +- [Credits](#credits) +- [Magic](#magic) + +## Example + +Using libpostal image to install [pypostal](https://github.com/openvenues/pypostal) package: + +```Dockerfile +FROM sleekybadger/libpostal:1.1-alpha-alpine as libpostal-build + +FROM python:3.7.1-alpine + +COPY --from=libpostal-build /data /data +COPY --from=libpostal-build /usr/lib/libpostal.so /usr/lib/libpostal.so +COPY --from=libpostal-build /usr/lib/libpostal.so.1 /usr/lib/libpostal.so.1 +COPY --from=libpostal-build /usr/include/libpostal /usr/include/libpostal + +RUN apk add --no-cache build-base +RUN pip install postal + +CMD ["python"] +``` + +## License + +docker-libpostal is released under the [MIT](https://opensource.org/licenses/MIT) license. + +## Credits + +Thanks to: + +* [@mhart](https://github.com/mhart) and his [alpine-node](https://github.com/mhart/alpine-node) +* [@dnephin](https://github.com/dnephin) and his [dobi](https://github.com/dnephin/dobi) + +## Magic + +(ノ◕ヮ◕)ノ*:・゚✧ diff --git a/dobi.yaml b/dobi.yaml new file mode 100644 index 0000000..c5c353f --- /dev/null +++ b/dobi.yaml @@ -0,0 +1,42 @@ +meta: + project: sleekybadger/libpostal + default: tag + +image=1.0.0: + context: . + dockerfile: 1.0.0/alpine/Dockerfile + image: '{project}' + tags: + - 1.0-alpine + - 1.0-alpine3.8 + - 1.0.0-alpine + - 1.0.0-alpha-alpine3.8 + +image=1.1-alpha: + context: . + dockerfile: 1.1-alpha/alpine/Dockerfile + image: '{project}' + tags: + - alpine + - alpine3.8 + - 1-alpine + - 1-alpine3.8 + - 1.1-alpine + - 1.1-alpine3.8 + - 1.1-alpha-alpine + - 1.1-alpha-alpine3.8 + - latest + +alias=tag: + tasks: + - 1.0.0:tag + - 1.1-alpha:tag + annotations: + description: Build and tag images + +alias=clean: + tasks: + - 1.0.0:rm + - 1.1-alpha:rm + annotations: + description: "Remove all images"