|
| 1 | +# Use: docker build --no-cache --build-arg PPA_TRACK="[staging|stable]" |
| 2 | + |
| 3 | +# Stage 0 - hashr-builder |
| 4 | +FROM golang:alpine AS hashr-builder |
| 5 | +RUN apk add --no-cache build-base |
| 6 | + |
| 7 | +# Compile hashr statically |
| 8 | +RUN mkdir -p /opt/hashr/ |
| 9 | +COPY . /opt/hashr/ |
| 10 | +RUN cd /opt/hashr/ && GOOS=linux GOARCH=amd64 go build -v -ldflags="-linkmode=external -extldflags=-static" -tags osusergo,netgo -o hashr hashr.go |
| 11 | + |
| 12 | +# Stage 1 - hashr |
1 | 13 | FROM ubuntu:22.04
|
2 | 14 |
|
3 |
| -# Use: docker build --no-cache --build-arg PPA_TRACK="[staging|stable]" |
4 | 15 | ARG PPA_TRACK=stable
|
5 |
| - |
6 | 16 | ENV DEBIAN_FRONTEND=noninteractive
|
7 |
| -#RUN apt-get update && apt-get -y upgrade |
8 |
| -RUN apt-get update |
9 |
| -RUN apt-get -y install \ |
| 17 | + |
| 18 | +RUN apt-get update && apt-get -y upgrade && apt-get -y install \ |
10 | 19 | p7zip-full \
|
11 | 20 | apt-transport-https \
|
12 | 21 | apt-utils \
|
13 | 22 | sudo \
|
14 | 23 | curl \
|
15 | 24 | file \
|
16 | 25 | gpg \
|
17 |
| - software-properties-common |
18 |
| - |
19 |
| -RUN rm -rf /var/lib/apt/lists/* |
| 26 | + software-properties-common \ |
| 27 | + && apt-get clean && rm -rf /var/cache/apt/* /var/lib/apt/lists/* |
20 | 28 |
|
21 |
| -RUN curl -sS https://keyserver.ubuntu.com/pks/lookup?op=get\&search=0x3ed1eaece81894b171d7da5b5e80511b10c598b8 | gpg --dearmor | sudo tee /etc/apt/trusted.gpg.d/gift.gpg |
22 | 29 | RUN add-apt-repository -y ppa:gift/$PPA_TRACK
|
23 |
| -RUN apt-get update && apt-get -y install \ |
24 |
| - plaso-tools \ |
25 |
| - --option Acquire::ForceIPv4=true --option Acquire::Retries=100 --option Acquire::http::Timeout=60 |
| 30 | +RUN apt-get update && apt-get -y install plaso-tools |
26 | 31 |
|
27 | 32 | RUN useradd -G disk,sudo -u 999 hashr
|
28 | 33 | RUN echo "hashr ALL = (root) NOPASSWD: /bin/mount,/bin/umount,/sbin/losetup,/bin/rm" > /etc/sudoers.d/hashr
|
29 | 34 |
|
30 | 35 | USER root
|
31 | 36 |
|
32 | 37 | WORKDIR /usr/local/bin
|
33 |
| -COPY hashr . |
| 38 | +COPY --from=hashr-builder /opt/hashr/hashr . |
34 | 39 |
|
35 | 40 | VOLUME ["/data"]
|
36 | 41 |
|
|
0 commit comments