Merge pull request #36363 from Crassirostris/fluentd-gcp-image-build-fix
Automatic merge from submit-queue Fix fluentd-gcp Dockerfile to reduce image size Change reduces image size by 150MB. @piosz
This commit is contained in:
		@@ -30,27 +30,29 @@ ENV DEBIAN_FRONTEND noninteractive
 | 
				
			|||||||
# Install build tools
 | 
					# Install build tools
 | 
				
			||||||
RUN apt-get -qq update && \
 | 
					RUN apt-get -qq update && \
 | 
				
			||||||
    apt-get install -y -qq curl ca-certificates gcc make bash sudo && \
 | 
					    apt-get install -y -qq curl ca-certificates gcc make bash sudo && \
 | 
				
			||||||
    apt-get install -y -qq --reinstall lsb-base lsb-release
 | 
					    apt-get install -y -qq --reinstall lsb-base lsb-release && \
 | 
				
			||||||
 | 
					 | 
				
			||||||
    # Install logging agent and required gems
 | 
					    # Install logging agent and required gems
 | 
				
			||||||
RUN /usr/bin/curl -sSL https://toolbelt.treasuredata.com/sh/install-ubuntu-xenial-td-agent2.sh | sh && \
 | 
					    /usr/bin/curl -sSL https://toolbelt.treasuredata.com/sh/install-ubuntu-xenial-td-agent2.sh | sh && \
 | 
				
			||||||
    sed -i -e "s/USER=td-agent/USER=root/" -e "s/GROUP=td-agent/GROUP=root/" /etc/init.d/td-agent && \
 | 
					    sed -i -e "s/USER=td-agent/USER=root/" -e "s/GROUP=td-agent/GROUP=root/" /etc/init.d/td-agent && \
 | 
				
			||||||
    td-agent-gem install --no-document fluent-plugin-record-reformer -v 0.8.2 && \
 | 
					    td-agent-gem install --no-document fluent-plugin-record-reformer -v 0.8.2 && \
 | 
				
			||||||
    td-agent-gem install --no-document fluent-plugin-systemd -v 0.0.5 && \
 | 
					    td-agent-gem install --no-document fluent-plugin-systemd -v 0.0.5 && \
 | 
				
			||||||
    td-agent-gem install --no-document fluent-plugin-google-cloud -v 0.5.2
 | 
					    td-agent-gem install --no-document fluent-plugin-google-cloud -v 0.5.2 && \
 | 
				
			||||||
 | 
					 | 
				
			||||||
    # Remove build tools
 | 
					    # Remove build tools
 | 
				
			||||||
RUN apt-get remove -y -qq gcc make && \
 | 
					    apt-get remove -y -qq gcc make && \
 | 
				
			||||||
    apt-get autoremove -y -qq && \
 | 
					    apt-get autoremove -y -qq && \
 | 
				
			||||||
    apt-get clean -qq
 | 
					    apt-get clean -qq && \
 | 
				
			||||||
 | 
					 | 
				
			||||||
    # Remove unnecessary files
 | 
					    # Remove unnecessary files
 | 
				
			||||||
RUN rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
 | 
					    rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* \
 | 
				
			||||||
 | 
					        /opt/td-agent/embedded/share/doc \
 | 
				
			||||||
 | 
					        /opt/td-agent/embedded/share/gtk-doc \
 | 
				
			||||||
 | 
					        /opt/td-agent/embedded/lib/postgresql \
 | 
				
			||||||
 | 
					        /opt/td-agent/embedded/bin/postgres \
 | 
				
			||||||
 | 
					        /opt/td-agent/embedded/share/postgresql \
 | 
				
			||||||
 | 
					        /etc/td-agent/td-agent.conf
 | 
				
			||||||
 | 
					
 | 
				
			||||||
# Copy the Fluentd configuration files for logging Docker container logs.
 | 
					# Copy the Fluentd configuration files for logging Docker container logs.
 | 
				
			||||||
# Either configuration file can be used by specifying `-c <file>` as a command
 | 
					# Either configuration file can be used by specifying `-c <file>` as a command
 | 
				
			||||||
# line argument.
 | 
					# line argument.
 | 
				
			||||||
RUN rm /etc/td-agent/td-agent.conf
 | 
					 | 
				
			||||||
COPY google-fluentd.conf /etc/td-agent/google-fluentd.conf
 | 
					COPY google-fluentd.conf /etc/td-agent/google-fluentd.conf
 | 
				
			||||||
COPY google-fluentd-journal.conf /etc/td-agent/google-fluentd-journal.conf
 | 
					COPY google-fluentd-journal.conf /etc/td-agent/google-fluentd-journal.conf
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user