Skip to content

Commit

Permalink
Add Dockerfile (#650)
Browse files Browse the repository at this point in the history
  • Loading branch information
Nicolas Gif authored and raphink committed Oct 30, 2019
1 parent 026b7f3 commit fa315ce
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 0 deletions.
22 changes: 22 additions & 0 deletions docker/Dockerfile
@@ -0,0 +1,22 @@
FROM alpine AS build

RUN apk add --no-cache --virtual=.build gcc libc-dev make bison flex readline-dev libxml2-dev git automake autoconf libtool pkgconf coreutils
COPY . /augeas
RUN set -ex ; \
cd augeas \
&& ./autogen.sh --prefix=/opt/augeas \
&& make \
&& make install

FROM alpine
RUN apk add --no-cache libgcc libxml2 readline bash
COPY --from=build /opt/augeas /opt/augeas
ENV PATH=$PATH:/opt/augeas/bin
RUN set -x ; \
cd /opt/augeas/bin \
&& for TOOL in augcheck auggrep augload augloadone augparsediff augsed ; \
do \
wget https://raw.githubusercontent.com/raphink/augeas-sandbox/master/"$TOOL" ; \
chmod +x "$TOOL" ; \
done
CMD augtool
19 changes: 19 additions & 0 deletions docker/README.md
@@ -0,0 +1,19 @@
Building the image
------------------

First clone augeas repository then, build the image:

```shell
git clone https://github.com/hercules-team/augeas.git
cd augeas
docker build -t augeas -f docker/Dockerfile .
```

Using the image
---------------

Here is an exemple to print ssh configuration:

```shell
docker container run -ti --rm -v /etc/ssh/:/etc/ssh augeas augtool print /files/etc/ssh
```

0 comments on commit fa315ce

Please sign in to comment.