-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile.linux
47 lines (37 loc) · 1.3 KB
/
Dockerfile.linux
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
# Dockerfile for Linux
#
# Build:
# docker build -t "smblinux:latest" -f Dockerfile.linux .
#
# Build with Kerberos support:
# docker build --progress plain -t "smblinux:latest" --build-arg WITH_KERBEROS=1 -f Dockerfile.linux .
#
# Run with no options:
# docker run --rm smblinux:latest
#
# Run a n2os-smb-client command directly:
# docker run --env N2OS_SMB_PASSWORD=${N2OS_SMB_PASSWORD} --rm -v "$PWD/bin":/usr/src/n2os-smb-client/bin:Z smblinux:latest ls smb://[email protected]/_media
#
# Interactive shell on the container image:
# docker run -ti --entrypoint /bin/bash smblinux:latest
# FROM debian:bookworm-slim # no upx at the moment
FROM debian:bullseye-slim AS builder
ARG WITH_KERBEROS
ENV WITH_KERBEROS=${WITH_KERBEROS}
# Used in GHA workflow
ARG ENV_ARM
ENV ENV_ARM=${ENV_ARM}
WORKDIR /usr/src/n2os-smb-client
COPY . .
# hadolint ignore=DL3008
RUN apt-get update && \
apt-get install -y --no-install-recommends git build-essential upx-ucl cmake libssl-dev libkrb5-dev && \
apt-get clean && rm -rf /var/lib/apt/lists/* && \
ldconfig && \
./build.linux.sh
FROM debian:bullseye-slim
RUN useradd -m nonroot
COPY --from=builder /usr/src/n2os-smb-client/bin/n2os_smb_client.linux /usr/bin/n2os_smb_client.linux
USER nonroot
WORKDIR /home/nonroot
ENTRYPOINT [ "/usr/bin/n2os_smb_client.linux" ]