Skip to content

Commit

Permalink
Remove all intermediate files in same layers
Browse files Browse the repository at this point in the history
- Remove untarred files that were previously missed by glob
- Remove files in layer they originate from

This is in line with the approach in telegraf's Dockerfiles
  • Loading branch information
jordajoSICKAG committed Aug 22, 2022
1 parent d0e9594 commit 60a9843
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 12 deletions.
6 changes: 3 additions & 3 deletions influxdb/2.3/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ RUN set -eux && \
gpg --batch --verify influxdb2-${INFLUXDB_VERSION}-linux-${ARCH}.tar.gz.asc influxdb2-${INFLUXDB_VERSION}-linux-${ARCH}.tar.gz && \
tar xzf influxdb2-${INFLUXDB_VERSION}-linux-${ARCH}.tar.gz && \
cp influxdb2_linux_${ARCH}/influxd /usr/local/bin/influxd && \
rm -rf influxdb2-* && \
influxd version

# Install the influx CLI
Expand All @@ -53,15 +54,14 @@ RUN set -eux && \
gpg --batch --verify influxdb2-client-${INFLUX_CLI_VERSION}-linux-${ARCH}.tar.gz.asc influxdb2-client-${INFLUX_CLI_VERSION}-linux-${ARCH}.tar.gz && \
tar xzf influxdb2-client-${INFLUX_CLI_VERSION}-linux-${ARCH}.tar.gz && \
cp influxdb2-client-${INFLUX_CLI_VERSION}-linux-${ARCH}/influx /usr/local/bin/influx && \
rm -rf influxdb2-* && \
influx version

# Remove GNUPG Configuration
RUN gpgconf --kill all && \
rm -rf \
"/root/.gnupg" \
influxdb2.key \
influxdb2-${INFLUXDB_VERSION}-linux-${ARCH}* \
influxdb2-client-${INFLUX_CLI_VERSION}-linux-${ARCH}*
influxdb2.key

# Create standard directories expected by the entry-point.
RUN mkdir /docker-entrypoint-initdb.d && \
Expand Down
6 changes: 3 additions & 3 deletions influxdb/2.3/alpine/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ RUN set -eux && \
gpg --batch --verify influxdb2-${INFLUXDB_VERSION}-linux-${ARCH}.tar.gz.asc influxdb2-${INFLUXDB_VERSION}-linux-${ARCH}.tar.gz && \
tar xzf influxdb2-${INFLUXDB_VERSION}-linux-${ARCH}.tar.gz && \
cp influxdb2_linux_${ARCH}/influxd /usr/local/bin/influxd && \
rm -rf influxdb2-* && \
influxd version

# Install the influx CLI
Expand All @@ -48,15 +49,14 @@ RUN set -eux && \
gpg --batch --verify influxdb2-client-${INFLUX_CLI_VERSION}-linux-${ARCH}.tar.gz.asc influxdb2-client-${INFLUX_CLI_VERSION}-linux-${ARCH}.tar.gz && \
tar xzf influxdb2-client-${INFLUX_CLI_VERSION}-linux-${ARCH}.tar.gz && \
cp influxdb2-client-${INFLUX_CLI_VERSION}-linux-${ARCH}/influx /usr/local/bin/influx && \
rm -rf influxdb2-* && \
influx version

# Remove GNUPG Configuration
RUN gpgconf --kill all && \
rm -rf \
"/root/.gnupg" \
influxdb2.key \
influxdb2-${INFLUXDB_VERSION}-linux-${ARCH}* \
influxdb2-client-${INFLUX_CLI_VERSION}-linux-${ARCH}*
influxdb2.key

# Create standard directories expected by the entry-point.
RUN mkdir /docker-entrypoint-initdb.d && \
Expand Down
6 changes: 3 additions & 3 deletions influxdb/2.4/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ RUN set -eux && \
gpg --batch --verify influxdb2-${INFLUXDB_VERSION}-linux-${ARCH}.tar.gz.asc influxdb2-${INFLUXDB_VERSION}-linux-${ARCH}.tar.gz && \
tar xzf influxdb2-${INFLUXDB_VERSION}-linux-${ARCH}.tar.gz && \
cp influxdb2_linux_${ARCH}/influxd /usr/local/bin/influxd && \
rm -rf influxdb2-* && \
influxd version

# Install the influx CLI
Expand All @@ -53,15 +54,14 @@ RUN set -eux && \
gpg --batch --verify influxdb2-client-${INFLUX_CLI_VERSION}-linux-${ARCH}.tar.gz.asc influxdb2-client-${INFLUX_CLI_VERSION}-linux-${ARCH}.tar.gz && \
tar xzf influxdb2-client-${INFLUX_CLI_VERSION}-linux-${ARCH}.tar.gz && \
cp influxdb2-client-${INFLUX_CLI_VERSION}-linux-${ARCH}/influx /usr/local/bin/influx && \
rm -rf influxdb2-* && \
influx version

# Remove GNUPG Configuration
RUN gpgconf --kill all && \
rm -rf \
"/root/.gnupg" \
influxdb2.key \
influxdb2-${INFLUXDB_VERSION}-linux-${ARCH}* \
influxdb2-client-${INFLUX_CLI_VERSION}-linux-${ARCH}*
influxdb2.key

# Create standard directories expected by the entry-point.
RUN mkdir /docker-entrypoint-initdb.d && \
Expand Down
6 changes: 3 additions & 3 deletions influxdb/2.4/alpine/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ RUN set -eux && \
gpg --batch --verify influxdb2-${INFLUXDB_VERSION}-linux-${ARCH}.tar.gz.asc influxdb2-${INFLUXDB_VERSION}-linux-${ARCH}.tar.gz && \
tar xzf influxdb2-${INFLUXDB_VERSION}-linux-${ARCH}.tar.gz && \
cp influxdb2_linux_${ARCH}/influxd /usr/local/bin/influxd && \
rm -rf influxdb2-* && \
influxd version

# Install the influx CLI
Expand All @@ -48,15 +49,14 @@ RUN set -eux && \
gpg --batch --verify influxdb2-client-${INFLUX_CLI_VERSION}-linux-${ARCH}.tar.gz.asc influxdb2-client-${INFLUX_CLI_VERSION}-linux-${ARCH}.tar.gz && \
tar xzf influxdb2-client-${INFLUX_CLI_VERSION}-linux-${ARCH}.tar.gz && \
cp influxdb2-client-${INFLUX_CLI_VERSION}-linux-${ARCH}/influx /usr/local/bin/influx && \
rm -rf influxdb2-* && \
influx version

# Remove GNUPG Configuration
RUN gpgconf --kill all && \
rm -rf \
"/root/.gnupg" \
influxdb2.key \
influxdb2-${INFLUXDB_VERSION}-linux-${ARCH}* \
influxdb2-client-${INFLUX_CLI_VERSION}-linux-${ARCH}*
influxdb2.key

# Create standard directories expected by the entry-point.
RUN mkdir /docker-entrypoint-initdb.d && \
Expand Down

0 comments on commit 60a9843

Please sign in to comment.