1
- # step 1: create a debian or ubuntu container for ugrep named "ugrep"
2
- # docker -D build --no-cache -t ugrep .
3
1
#
4
- # step 2: run bash in the container, e.g. to run ugrep from the command line
5
- # docker run -it ugrep bash
6
- # or
7
- # docker run -it --mount type=bind,source=$PWD,target=/mnt ugrep bash
2
+ # Dockerfile to build and run ugrep in a container (development environment).
8
3
#
9
- # step 3: run ugrep in the container, for example:
10
- # ugrep -r -n -tjava Hello ugrep/tests/
4
+ # This file creates the environment to build and run ugrep in a container. If
5
+ # you just want to use ugrep in a minimal container, use the minimized Dockerfile.
6
+ #
7
+ # Build the ugrep image:
8
+ # $ docker build -t ugrep .
9
+ #
10
+ # Execute ugrep in the container (The / of the host is accessible in /mnt directory in the container):
11
+ # $ docker run -v /:/mnt -it ugrep --help
12
+ # or run bash in the container instead:
13
+ # $ docker run -v /:/mnt --entrypoint /bin/bash -it ugrep
14
+ # $ ugrep --help
11
15
12
- # debian or ubuntu
13
16
FROM ubuntu
14
17
15
18
RUN apt-get update
16
19
17
- RUN apt-get install -y \
20
+ RUN apt-get install -y --no-install-recommends \
21
+ autoconf \
22
+ automake \
23
+ build-essential \
24
+ ca-certificates \
25
+ pkg-config \
18
26
make \
19
- vim \
20
27
git \
21
28
clang \
22
- wget \
23
29
unzip \
24
30
libpcre2-dev \
25
31
libz-dev \
@@ -29,9 +35,18 @@ RUN apt-get install -y \
29
35
libzstd-dev \
30
36
libbrotli-dev
31
37
32
- RUN cd / && \
33
- git clone https://github.com/Genivia/ugrep
38
+ WORKDIR /ugrep
39
+
40
+ # Clone ugrep from GitHub
41
+ RUN git clone --single-branch --depth=1 https://github.com/Genivia/ugrep /ugrep
42
+
43
+ # Local build of ugrep
44
+ # If you want to build ugrep from a local source, uncomment the following line:
45
+ # ADD . /ugrep
46
+
47
+ RUN autoreconf -fi
48
+ RUN ./build.sh
49
+ RUN make install
50
+ RUN ugrep --version
34
51
35
- RUN cd ugrep && \
36
- ./build.sh && \
37
- make install
52
+ ENTRYPOINT [ "ugrep" ]
0 commit comments