Skip to content

Commit

Permalink
Initial
Browse files Browse the repository at this point in the history
  • Loading branch information
sleekybadger committed Dec 11, 2018
0 parents commit b8812eb
Show file tree
Hide file tree
Showing 8 changed files with 205 additions and 0 deletions.
7 changes: 7 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
.git
.gitignore
LICENSE
README.md
.hadolint.yaml
dobi.yaml
.dobi
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
.dobi
4 changes: 4 additions & 0 deletions .hadolint.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
ignored:
- DL3003
- DL4006
- DL3018
38 changes: 38 additions & 0 deletions 1.0.0/alpine/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
FROM alpine:3.8

LABEL version="1.0.0" \
maintainer="[email protected]"

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
38 changes: 38 additions & 0 deletions 1.1-alpha/alpine/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
FROM alpine:3.8

LABEL version="1.0.0" \
maintainer="[email protected]"

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
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -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.
54 changes: 54 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -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

(ノ◕ヮ◕)ノ*:・゚✧
42 changes: 42 additions & 0 deletions dobi.yaml
Original file line number Diff line number Diff line change
@@ -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"

0 comments on commit b8812eb

Please sign in to comment.