Skip to content

Commit c537192

Browse files
committed
Update Dockerfile with WORKDIR
1 parent b4306e5 commit c537192

File tree

1 file changed

+13
-9
lines changed

1 file changed

+13
-9
lines changed

Dockerfile

+13-9
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
FROM --platform=linux/amd64 ubuntu:20.04
22

3+
ENV WORKDIR="/home/user"
4+
35
ARG CLIENT_ID=""
46
ARG CLIENT_SECRET=""
57
ARG API_BASE_URL=""
@@ -20,34 +22,36 @@ RUN mkdir -p /var/log/crowdstrike/falconhoseclient
2022
RUN chown -R user:user /var/log/crowdstrike/falconhoseclient
2123
RUN chmod -R 755 /var/log/crowdstrike/falconhoseclient
2224

23-
WORKDIR /home/user
25+
WORKDIR "${WORKDIR}"
2426

2527
# CrowdStrike deb package
26-
COPY deb/crowdstrike-cs-falconhoseclient_2.18.0_amd64.deb ./crowdstrike.deb
27-
RUN dpkg -i ./crowdstrike.deb
28+
COPY deb/crowdstrike-cs-falconhoseclient_2.18.0_amd64.deb "${WORKDIR}/crowdstrike.deb"
29+
RUN dpkg -i "${WORKDIR}/crowdstrike.deb"
2830

2931
# Change user access to the configuration files (could be better)
3032
RUN chown -R user:user /opt/crowdstrike/etc/
3133

3234
# Entrypoint
33-
COPY entrypoint.sh .
34-
RUN chmod +x ./entrypoint.sh
35+
COPY entrypoint.sh "${WORKDIR}"
36+
RUN chmod +x "${WORKDIR}/entrypoint.sh"
3537

3638
# CrowdStrike configuration file
37-
COPY cfg/cs.falconhoseclient.cfg.template .
39+
COPY cfg/cs.falconhoseclient.cfg.template "${WORKDIR}"
3840

3941
# Environment setup (if defined the values are used in the entrypoint)
40-
COPY .env .
42+
COPY .env "${WORKDIR}"
4143

4244
# Install required certificates
4345
# This step is not always required but it certainly avoids some problems
4446
RUN curl -s -o /etc/ssl/certs/DigiCertHighAssuranceEVRootCA.crt https://www.digicert.com/CACerts/DigiCertHighAssuranceEVRootCA.crt
4547
RUN curl -s -o /etc/ssl/certs/DigiCertAssuredIDRootCA.crt https://dl.cacerts.digicert.com/DigiCertAssuredIDRootCA.crt
4648

4749
# Change owner of workdir
48-
RUN chown -R user:user /home/user
50+
RUN chown -R user:user "${WORKDIR}"
4951

5052
# Change to user
5153
USER user
5254

53-
ENTRYPOINT [ "./entrypoint.sh" ]
55+
ENV PATH="${WORKDIR}:${PATH}"
56+
57+
ENTRYPOINT [ "entrypoint.sh" ]

0 commit comments

Comments
 (0)