-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
59 lines (48 loc) · 1.98 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
FROM busybox as warchaeology
ARG WARCHAEOLOGY_VERSION=1.1.0
RUN wget https://github.com/nlnwa/warchaeology/releases/download/v${WARCHAEOLOGY_VERSION}/checksums.txt
RUN wget https://github.com/nlnwa/warchaeology/releases/download/v${WARCHAEOLOGY_VERSION}/warchaeology_Linux_x86_64.tar.gz
RUN grep warchaeology_Linux_x86_64.tar.gz < checksums.txt | sha256sum -c -
RUN tar xvzf warchaeology_Linux_x86_64.tar.gz && chmod +x warc
FROM python:3.12-slim-bookworm
LABEL maintainer="[email protected]"
# Install dependencies
RUN apt-get update -y \
&& apt-get install -y yq xq jq gettext tree bash-completion \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*
# Create a non-root user
RUN useradd --create-home --shell /bin/bash nonroot
USER nonroot
WORKDIR /home/nonroot
RUN echo "\n\
echo \n\
echo ' :-==-.'\n\
echo ' .%@@@@@#='\n\
echo ' #@@@@+'\n\
echo ' @@@@#'\n\
echo ' %@@@#'\n\
echo ' -@@@@@.'\n\
echo ' :+%@@@@@@*'\n\
echo ' -+%@@@@@@@@@@@'\n\
echo ' :+%@@@@@@@@@@@@@@@-'\n\
echo ' -*@@@@@@@@@@@@@#.@@@@:'\n\
echo ' -*@@@@@@@@@@@@@@%= :@@@%'\n\
echo ' :*@@@@@@@@@@@@@@%+: .+@@@%.'\n\
echo ' .=%@@@@@@@@@@@%*=: .-+%@@@@*'\n\
echo ' .-*%@@@@@@@@##*+===+*#@@@@@@@+.'\n\
echo ' .+%@%%%@@@@@@@@@@@@@@@@@@@@@@*-'\n\
echo ' :=+*#%@@@@@@@@@@#-.'\n\
echo ' .=#@@+'\n\
echo \
" >> /home/nonroot/.bashrc
# Set the locale (needed for python)
ENV LANG=C.UTF-8
# Add local bin to path
ENV PATH=/home/nonroot/.local/bin:$PATH
# Install warctools
RUN pip --no-cache-dir install --user warctools
# Install warchaeology
COPY --from=warchaeology /warc .local/bin/warc
COPY --from=warchaeology /completions/warc.bash .local/share/bash-completion/completions/warc
ENTRYPOINT ["/bin/bash"]