Navigation Menu

Skip to content

Commit

Permalink
Merge pull request #290 from funcoeszz/docker
Browse files Browse the repository at this point in the history
Rodar Funções ZZ via Docker
  • Loading branch information
aureliojargas committed Nov 18, 2016
2 parents 9632696 + ba0d0dd commit 16d1f65
Show file tree
Hide file tree
Showing 4 changed files with 58 additions and 3 deletions.
1 change: 1 addition & 0 deletions .dockerignore
@@ -0,0 +1 @@
.git
28 changes: 28 additions & 0 deletions Dockerfile
@@ -0,0 +1,28 @@
FROM debian:jessie
MAINTAINER Aurelio Jargas <verde@aurelio.net>

RUN apt-get update && \
DEBIAN_FRONTEND=noninteractive apt-get install -y bc curl lynx links && \
rm -rf /var/lib/apt/lists/*

# Using dumb-init to catch user signals https://github.com/funcoeszz/funcoeszz/issues/374
RUN curl -fsSL https://github.com/Yelp/dumb-init/releases/download/v1.2.0/dumb-init_1.2.0_amd64 > /dumb-init && \
chmod +x /dumb-init

ENV PATH=/app:$PATH \
ZZPATH=/app/funcoeszz \
ZZDIR=/app/zz \
ZZTMPDIR=/tmp \
LC_ALL=C.UTF-8 \
TERM=xterm \
PAGER=more

# User may want to preserve the functions cache
VOLUME /tmp

COPY funcoeszz /app/
COPY zz/ /app/zz/
WORKDIR /app

ENTRYPOINT ["/dumb-init", "--", "bash", "funcoeszz"]
CMD ["--help"]
30 changes: 28 additions & 2 deletions README.md
Expand Up @@ -49,11 +49,37 @@ Agora sim, você pode usar as Funções ZZ em toda a sua glória. Abra um novo t

$ zzcalcula 10+5
15

$ zzbissexto 2016
2016 é bissexto

$ zzmaiusculas tá funcionando
TÁ FUNCIONANDO

Quando quiser atualizar os arquivos para a versão mais recente, basta um `git pull`.

## Execução via Docker

A imagem oficial das Funções ZZ é a [funcoeszz/zz](https://hub.docker.com/r/funcoeszz/zz/).

Primeiro, baixe-a para a sua máquina:

```
docker pull funcoeszz/zz
```

Agora basta rodar o contêiner e informar qual função você quer usar, junto com seus parâmetros:

```console
$ docker run --rm funcoeszz/zz horariodeverao
16/10/2016
19/02/2017

$ docker run --rm funcoeszz/zz senha 30
pipj74x30fEbzbx0rcPEwukL2WKjCA

$ docker run --rm funcoeszz/zz maiusculas tá funcionando
TÁ FUNCIONANDO
```

**Desenvolvedor:** Para instruções sobre como construir esta imagem, ou como rodar outro tipo de comandos dentro do contêiner, [veja esta wiki](https://github.com/funcoeszz/funcoeszz/wiki/Docker)
2 changes: 1 addition & 1 deletion zz/zzlembrete.sh
Expand Up @@ -16,7 +16,7 @@ zzlembrete ()
zzzz -h lembrete "$1" && return

local numero tmp
local arquivo="$HOME/.zzlembrete"
local arquivo="${ZZTMPDIR:-$HOME}/.zzlembrete"

# Assegura-se que o arquivo de lembretes existe
test -f "$arquivo" || touch "$arquivo"
Expand Down

0 comments on commit 16d1f65

Please sign in to comment.