-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
simplify the template to include all logs from the docker direcotory.
This way even if you start the container before all other conatiners the logroatet will always work for all logs. Remove the size condition form the template as date and size cannot exist in the same tmeplate Update the documentation with the changes
- Loading branch information
Krasimir Georgiev
committed
Mar 26, 2015
1 parent
0d98008
commit 8f42f76
Showing
4 changed files
with
13 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,10 +5,6 @@ MAINTAINER Michal Raczka [email protected] | |
RUN apt-get update \ | ||
&& apt-get install -y curl | ||
|
||
# install docker-gen | ||
RUN curl -sL https://github.com/jwilder/docker-gen/releases/download/0.3.2/docker-gen-linux-amd64-0.3.2.tar.gz \ | ||
| tar -xz -C /usr/local/bin | ||
|
||
# install go-cron | ||
RUN curl -sL https://github.com/michaloo/go-cron/releases/download/v0.0.2/go-cron.tar.gz \ | ||
| tar -x -C /usr/local/bin | ||
|
@@ -18,21 +14,21 @@ ADD . /app | |
WORKDIR /app | ||
|
||
# clear logrotate ubuntu installation and modify logrotate script | ||
# add docker-gen execution and enable debug mode | ||
RUN rm /etc/logrotate.d/* && \ | ||
sed -i \ | ||
# add the template and enable debug mode | ||
RUN rm /etc/logrotate.d/* \ | ||
&& cp /app/logrotate.tmpl /etc/logrotate.d/docker \ | ||
&& chmod 0644 /etc/logrotate.d/docker \ | ||
&& sed -i \ | ||
-e 's/^\/usr\/sbin\/logrotate.*/\/usr\/sbin\/logrotate \-v \/etc\/logrotate.conf/' \ | ||
-e '/\#\!\/bin\/sh/a /usr/local/bin/docker-gen /root/logrotate.tmpl /etc/logrotate.d/docker' \ | ||
/etc/cron.daily/logrotate | ||
|
||
#&& apt-get clean \ | ||
#&& rm -rf /var/lib/apt/lists/* | ||
# set default configuration | ||
ENV DOCKER_HOST unix:///var/run/docker.sock | ||
ENV DOCKER_DIR /var/lib/docker/ | ||
ENV GOCRON_SCHEDULER 0 0 * * * * | ||
|
||
ENV LOGROTATE_MODE daily | ||
ENV LOGROTATE_ROTATE 3 | ||
ENV LOGROTATE_SIZE 512M | ||
ENV LOGROTATE_ROTATE 7 | ||
|
||
ENTRYPOINT [ "/bin/bash" ] | ||
CMD [ "/app/start" ] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters