Skip to content

Commit

Permalink
Merge pull request #891 from uselagoon/dockerfile_package_tidy
Browse files Browse the repository at this point in the history
Dockerfile package tidy and add rsync & tar to all images
  • Loading branch information
tobybellwood authored Dec 10, 2023
2 parents 17b9bfd + 7feaedf commit 652e281
Show file tree
Hide file tree
Showing 39 changed files with 322 additions and 207 deletions.
3 changes: 3 additions & 0 deletions .git-blame-ignore-revs
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# .git-blame-ignore-revs
# reorganize dockerfile package adds
37306f3f697d15433085ceb9863e45f168ced87e
6 changes: 4 additions & 2 deletions images/commons/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,10 @@ COPY --from=envplate /usr/local/bin/ep /bin/ep

RUN apk update \
&& apk add --no-cache \
curl \
tini \
curl \
rsync \
tar \
tini \
&& rm -rf /var/cache/apk/* \
&& mkdir -p /lagoon/crontabs && fix-permissions /lagoon/crontabs \
&& ln -s /home/.bashrc /home/.profile
Expand Down
16 changes: 10 additions & 6 deletions images/mariadb/10.11.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ ENV MARIADB_DATABASE=lagoon \
MARIADB_PASSWORD=lagoon \
MARIADB_ROOT_PASSWORD=Lag00n

RUN \
apk add --no-cache --virtual .common-run-deps \
RUN apk update \
&& apk add --no-cache --virtual .common-run-deps \
bash \
curl \
gettext \
Expand All @@ -44,11 +44,15 @@ RUN \
mariadb-connector-c \
net-tools \
pwgen \
rsync \
tar \
tini \
tzdata \
wget; \
rm -rf /tmp/* /var/tmp/* /var/cache/apk/* /var/cache/distfiles/*; \
rm -rf /var/lib/mysql/* /etc/mysql/ /etc/my.cnf*; \
curl -sSL https://raw.githubusercontent.com/major/MySQLTuner-perl/master/mysqltuner.pl -o mysqltuner.pl
wget \
&& rm -rf /var/cache/apk/* \
&& rm -rf /tmp/* /var/tmp/* /var/cache/distfiles/* \
&& rm -rf /var/lib/mysql/* /etc/mysql/ /etc/my.cnf* \
&& curl -sSL https://raw.githubusercontent.com/major/MySQLTuner-perl/master/mysqltuner.pl -o mysqltuner.pl

COPY entrypoints/ /lagoon/entrypoints/
COPY mysql-backup.sh /lagoon/
Expand Down
15 changes: 9 additions & 6 deletions images/mariadb/10.4.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ ENV MARIADB_DATABASE=lagoon \
MARIADB_PASSWORD=lagoon \
MARIADB_ROOT_PASSWORD=Lag00n

RUN \
apk add --no-cache --virtual .common-run-deps \
RUN apk update \
&& apk add --no-cache --virtual .common-run-deps \
bash \
curl \
gettext \
Expand All @@ -44,12 +44,15 @@ RUN \
mariadb-connector-c \
net-tools \
pwgen \
rsync \
tar \
tini \
tzdata \
wget; \
rm -rf /tmp/* /var/tmp/* /var/cache/apk/* /var/cache/distfiles/*; \
rm -rf /var/lib/mysql/* /etc/mysql/ /etc/my.cnf*; \
curl -sSL https://raw.githubusercontent.com/major/MySQLTuner-perl/master/mysqltuner.pl -o mysqltuner.pl
wget \
&& rm -rf /var/cache/apk/* \
&& rm -rf /tmp/* /var/tmp/* /var/cache/distfiles/* \
&& rm -rf /var/lib/mysql/* /etc/mysql/ /etc/my.cnf* \
&& curl -sSL https://raw.githubusercontent.com/major/MySQLTuner-perl/master/mysqltuner.pl -o mysqltuner.pl

COPY entrypoints/ /lagoon/entrypoints/
COPY mysql-backup.sh /lagoon/
Expand Down
15 changes: 9 additions & 6 deletions images/mariadb/10.5.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ ENV MARIADB_DATABASE=lagoon \
MARIADB_PASSWORD=lagoon \
MARIADB_ROOT_PASSWORD=Lag00n

RUN \
apk add --no-cache --virtual .common-run-deps \
RUN apk update \
&& apk add --no-cache --virtual .common-run-deps \
bash \
curl \
gettext \
Expand All @@ -44,12 +44,15 @@ RUN \
mariadb-connector-c \
net-tools \
pwgen \
rsync \
tar \
tini \
tzdata \
wget; \
rm -rf /tmp/* /var/tmp/* /var/cache/apk/* /var/cache/distfiles/*; \
rm -rf /var/lib/mysql/* /etc/mysql/ /etc/my.cnf*; \
curl -sSL https://raw.githubusercontent.com/major/MySQLTuner-perl/master/mysqltuner.pl -o mysqltuner.pl
wget \
&& rm -rf /var/cache/apk/* \
&& rm -rf /tmp/* /var/tmp/* /var/cache/distfiles/* \
&& rm -rf /var/lib/mysql/* /etc/mysql/ /etc/my.cnf* \
&& curl -sSL https://raw.githubusercontent.com/major/MySQLTuner-perl/master/mysqltuner.pl -o mysqltuner.pl

COPY entrypoints/ /lagoon/entrypoints/
COPY mysql-backup.sh /lagoon/
Expand Down
15 changes: 9 additions & 6 deletions images/mariadb/10.6.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ ENV MARIADB_DATABASE=lagoon \
MARIADB_PASSWORD=lagoon \
MARIADB_ROOT_PASSWORD=Lag00n

RUN \
apk add --no-cache --virtual .common-run-deps \
RUN apk update \
&& apk add --no-cache --virtual .common-run-deps \
bash \
curl \
gettext \
Expand All @@ -44,12 +44,15 @@ RUN \
mariadb-connector-c \
net-tools \
pwgen \
rsync \
tar \
tini \
tzdata \
wget; \
rm -rf /tmp/* /var/tmp/* /var/cache/apk/* /var/cache/distfiles/*; \
rm -rf /var/lib/mysql/* /etc/mysql/ /etc/my.cnf*; \
curl -sSL https://raw.githubusercontent.com/major/MySQLTuner-perl/master/mysqltuner.pl -o mysqltuner.pl
wget \
&& rm -rf /var/cache/apk/* \
&& rm -rf /tmp/* /var/tmp/* /var/cache/distfiles/* \
&& rm -rf /var/lib/mysql/* /etc/mysql/ /etc/my.cnf* \
&& curl -sSL https://raw.githubusercontent.com/major/MySQLTuner-perl/master/mysqltuner.pl -o mysqltuner.pl

COPY entrypoints/ /lagoon/entrypoints/
COPY mysql-backup.sh /lagoon/
Expand Down
6 changes: 4 additions & 2 deletions images/mongo/4.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,10 @@ ENV TMPDIR=/tmp \
# Alpine 3.9 is the last release of the alpine mongodb package under OS license
RUN echo 'http://dl-cdn.alpinelinux.org/alpine/v3.9/main' >> /etc/apk/repositories
RUN echo 'http://dl-cdn.alpinelinux.org/alpine/v3.9/community' >> /etc/apk/repositories
RUN apk update
RUN apk add mongodb=4.0.5-r0
RUN apk update \
&& apk add --no-cache \
mongodb=4.0.5-r0 \
&& rm -rf /var/cache/apk/*

RUN mkdir -p /data/db /data/configdb && \
fix-permissions /data/db && \
Expand Down
8 changes: 6 additions & 2 deletions images/nginx/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,12 @@ ENV TMPDIR=/tmp \
# When Bash is invoked as non-interactive (like `bash -c command`) it sources a file that is given in `BASH_ENV`
BASH_ENV=/home/.bashrc

RUN apk add --no-cache \
openssl
RUN apk update \
&& apk add --no-cache \
openssl \
rsync \
tar \
&& rm -rf /var/cache/apk/*

RUN rm -Rf /etc/nginx && ln -s /usr/local/openresty/nginx/conf /etc/nginx

Expand Down
36 changes: 18 additions & 18 deletions images/node-builder/18.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,25 +8,25 @@ ENV LAGOON=node

RUN apk update \
&& apk add --no-cache \
libstdc++ \
libstdc++ \
&& apk add --no-cache \
bash \
binutils-gold \
ca-certificates \
curl \
file \
g++ \
gcc \
gcompat \
git \
gnupg \
libgcc \
libpng-dev \
linux-headers \
make \
openssl \
python3 \
wget \
bash \
binutils-gold \
ca-certificates \
curl \
file \
g++ \
gcc \
gcompat \
git \
gnupg \
libgcc \
libpng-dev \
linux-headers \
make \
openssl \
python3 \
wget \
&& rm -rf /var/cache/apk/*

CMD ["/bin/docker-sleep"]
36 changes: 18 additions & 18 deletions images/node-builder/20.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,25 +8,25 @@ ENV LAGOON=node

RUN apk update \
&& apk add --no-cache \
libstdc++ \
libstdc++ \
&& apk add --no-cache \
bash \
binutils-gold \
ca-certificates \
curl \
file \
g++ \
gcc \
gcompat \
git \
gnupg \
libgcc \
libpng-dev \
linux-headers \
make \
openssl \
python3 \
wget \
bash \
binutils-gold \
ca-certificates \
curl \
file \
g++ \
gcc \
gcompat \
git \
gnupg \
libgcc \
libpng-dev \
linux-headers \
make \
openssl \
python3 \
wget \
&& rm -rf /var/cache/apk/*

CMD ["/bin/docker-sleep"]
24 changes: 13 additions & 11 deletions images/node-cli/18.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,23 +6,25 @@ LABEL org.opencontainers.image.source="https://github.com/uselagoon/lagoon-image

ENV LAGOON=node

RUN apk add --no-cache git \
unzip \
gzip \
bash \
openssh-client \
rsync \
patch \
procps \
RUN apk update \
&& apk add --no-cache bash \
coreutils \
findutils \
git \
gzip \
mariadb-client \
mariadb-connector-c \
postgresql-client \
mongodb-tools \
openssh-client \
openssh-sftp-server \
findutils \
&& ln -s /usr/lib/ssh/sftp-server /usr/local/bin/sftp-server \
patch \
postgresql-client \
procps \
rsync \
tar \
unzip \
&& rm -rf /var/cache/apk/* \
&& ln -s /usr/lib/ssh/sftp-server /usr/local/bin/sftp-server \
&& mkdir -p /home/.ssh \
&& fix-permissions /home/

Expand Down
24 changes: 13 additions & 11 deletions images/node-cli/20.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,23 +6,25 @@ LABEL org.opencontainers.image.source="https://github.com/uselagoon/lagoon-image

ENV LAGOON=node

RUN apk add --no-cache git \
unzip \
gzip \
bash \
openssh-client \
rsync \
patch \
procps \
RUN apk update \
&& apk add --no-cache bash \
coreutils \
findutils \
git \
gzip \
mariadb-client \
mariadb-connector-c \
postgresql-client \
mongodb-tools \
openssh-client \
openssh-sftp-server \
findutils \
&& ln -s /usr/lib/ssh/sftp-server /usr/local/bin/sftp-server \
patch \
postgresql-client \
procps \
rsync \
tar \
unzip \
&& rm -rf /var/cache/apk/* \
&& ln -s /usr/lib/ssh/sftp-server /usr/local/bin/sftp-server \
&& mkdir -p /home/.ssh \
&& fix-permissions /home/

Expand Down
3 changes: 0 additions & 3 deletions images/node/18.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,6 @@ ENV TMPDIR=/tmp \
# When Bash is invoked as non-interactive (like `bash -c command`) it sources a file that is given in `BASH_ENV`
BASH_ENV=/home/.bashrc

RUN apk update \
&& rm -rf /var/cache/apk/*

# Make sure Bower and NPM are allowed to be running as root
RUN echo '{ "allow_root": true }' > /home/.bowerrc \
&& echo 'unsafe-perm=true' > /home/.npmrc
Expand Down
3 changes: 0 additions & 3 deletions images/node/20.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,6 @@ ENV TMPDIR=/tmp \
# When Bash is invoked as non-interactive (like `bash -c command`) it sources a file that is given in `BASH_ENV`
BASH_ENV=/home/.bashrc

RUN apk update \
&& rm -rf /var/cache/apk/*

# Make sure Bower and NPM are allowed to be running as root
RUN echo '{ "allow_root": true }' > /home/.bowerrc \
&& echo 'unsafe-perm=true' > /home/.npmrc
Expand Down
7 changes: 6 additions & 1 deletion images/opensearch/2.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,12 @@ COPY --from=commons /home /home

USER root

RUN dnf update --releasever=latest -y && dnf install -y findutils && dnf clean all
RUN dnf update --releasever=latest -y \
&& dnf install -y \
findutils \
rsync \
tar \
&& dnf clean all

RUN architecture=$(case $(uname -m) in x86_64 | amd64) echo "amd64" ;; aarch64 | arm64 | armv8) echo "arm64" ;; *) echo "amd64" ;; esac) \
&& curl -sL https://github.com/krallin/tini/releases/download/v0.19.0/tini-${architecture} -o /usr/sbin/tini && chmod a+x /usr/sbin/tini
Expand Down
7 changes: 4 additions & 3 deletions images/php-cli/8.0.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ LABEL org.opencontainers.image.source="https://github.com/uselagoon/lagoon-image

ENV LAGOON=cli

RUN apk add --no-cache git \
RUN apk update \
&& apk add --no-cache git \
bash \
coreutils \
findutils \
Expand All @@ -24,8 +25,8 @@ RUN apk add --no-cache git \
rsync \
unzip \
yarn \
&& ln -s /usr/lib/ssh/sftp-server /usr/local/bin/sftp-server \
&& rm -rf /var/cache/apk/*
&& rm -rf /var/cache/apk/* \
&& ln -s /usr/lib/ssh/sftp-server /usr/local/bin/sftp-server

RUN curl -L -o /usr/local/bin/composer https://github.com/composer/composer/releases/download/2.6.6/composer.phar \
&& chmod +x /usr/local/bin/composer \
Expand Down
Loading

0 comments on commit 652e281

Please sign in to comment.