Skip to content

Commit

Permalink
combine all setup commands into one RUN statement
Browse files Browse the repository at this point in the history
fixed 2/3 errors that hadolint pointed out
  • Loading branch information
churnikov committed Mar 12, 2024
1 parent e36c629 commit c3ab1b2
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 11 deletions.
5 changes: 4 additions & 1 deletion examples/streamlit/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,10 @@ WORKDIR $HOME/app
RUN apt-get update && apt-get install --no-install-recommends -y \
build-essential \
software-properties-common \
curl
curl \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*


COPY requirements.txt requirements.txt
COPY app.py app.py
Expand Down
16 changes: 9 additions & 7 deletions serve-encrypt/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,16 +1,18 @@
# Use an official Debian as a parent image for a lightweight build
FROM debian:stable-slim

# Install PostgreSQL client and GPG
RUN apt-get update && apt-get install --no-install-recommends -y gnupg2 curl postgresql-client && apt-get clean && rm -rf /var/lib/apt/lists/*
# Set the GNUPGHOME environment variable
ENV GNUPGHOME=/home/pguser/.gnupg

# Install PostgreSQL client and GPG
# Create a non-root user and group (using user ID 1000 and group ID 1000 for compatibility)
# Fixed commands for Debian
RUN groupadd -g 1000 pguser && \
useradd -m -u 1000 -g pguser pguser

# Set the GNUPGHOME environment variable
ENV GNUPGHOME=/home/pguser/.gnupg
RUN apt-get update \
&& apt-get install --no-install-recommends -y gnupg2 curl postgresql-client \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/* \
&& groupadd -g 1000 pguser \
&& useradd -m -u 1000 -g pguser pguser

# Set working directory
WORKDIR /home/pguser
Expand Down
6 changes: 3 additions & 3 deletions serve-filemanager/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ COPY filebrowser.json /.filebrowser.json

COPY startup.sh /usr/local/bin/startup.sh
RUN apk add --update --no-cache \
wget \
zip \
unzip \
wget=1.21.4 \
zip=3.0-r12 \
unzip=6.0-r14 \
&& adduser -D -u 1000 -g 1000 -h $HOME $USER \
&& chmod +x /usr/local/bin/startup.sh \
&& rm -rf /var/lib/apt/lists/*
Expand Down

0 comments on commit c3ab1b2

Please sign in to comment.