-
Notifications
You must be signed in to change notification settings - Fork 151
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added debug packages installation when SONIC_CONFIG_DEBUG enabled. #4
Changes from 9 commits
9e22d74
915f0fc
5ee19b9
337a241
dfb5c2f
73b5fce
1ae8aaa
4b42689
6472097
3d8447d
d2c8bef
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
FROM debian:jessie | ||
|
||
## Clean documentation in FROM image | ||
RUN find /usr/share/doc -depth \( -type f -o -type l \) ! -name copyright | xargs rm || true | ||
## Clean doc directories that are empty or only contain empty directories | ||
RUN while [ -n "$(find /usr/share/doc -depth -type d -empty -print -exec rmdir {} +)" ]; do :; done | ||
RUN rm -rf \ | ||
/usr/share/man/* \ | ||
/usr/share/groff/* \ | ||
/usr/share/info/* \ | ||
/usr/share/lintian/* \ | ||
/usr/share/linda/* \ | ||
/var/cache/man/* \ | ||
/usr/share/locale/* | ||
|
||
## Set the apt source | ||
COPY sources.list /etc/apt/sources.list | ||
COPY dpkg_01_drop /etc/dpkg/dpkg.cfg.d/01_drop | ||
RUN apt-get clean && apt-get update | ||
|
||
## Pre-install the fundamental packages | ||
RUN apt-get -y install \ | ||
rsyslog \ | ||
vim-tiny \ | ||
perl \ | ||
python | ||
|
||
COPY rsyslog.conf /etc/rsyslog.conf | ||
|
||
RUN apt-get -y purge \ | ||
exim4 \ | ||
exim4-base \ | ||
exim4-config \ | ||
exim4-daemon-light | ||
|
||
## Clean up apt | ||
## Remove /var/lib/apt/lists/*, could be obsoleted for derived images | ||
RUN apt-get clean -y; apt-get autoclean -y; apt-get autoremove -y; \ | ||
rm -rf /var/lib/apt/lists/*; \ | ||
rm -rf /tmp/*; | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
FROM debian:jessie | ||
|
||
## Clean documentation in FROM image | ||
RUN find /usr/share/doc -depth \( -type f -o -type l \) ! -name copyright | xargs rm || true | ||
## Clean doc directories that are empty or only contain empty directories | ||
RUN while [ -n "$(find /usr/share/doc -depth -type d -empty -print -exec rmdir {} +)" ]; do :; done | ||
RUN rm -rf \ | ||
/usr/share/man/* \ | ||
/usr/share/groff/* \ | ||
/usr/share/info/* \ | ||
/usr/share/lintian/* \ | ||
/usr/share/linda/* \ | ||
/var/cache/man/* \ | ||
/usr/share/locale/* | ||
|
||
## Set the apt source | ||
COPY sources.list /etc/apt/sources.list | ||
COPY dpkg_01_drop /etc/dpkg/dpkg.cfg.d/01_drop | ||
RUN apt-get clean && apt-get update | ||
|
||
## Pre-install the fundamental packages | ||
RUN apt-get -y install \ | ||
rsyslog \ | ||
vim-tiny \ | ||
perl \ | ||
python | ||
|
||
COPY rsyslog.conf /etc/rsyslog.conf | ||
|
||
RUN apt-get -y purge \ | ||
exim4 \ | ||
exim4-base \ | ||
exim4-config \ | ||
exim4-daemon-light | ||
|
||
## Install common debug-packages | ||
{% if docker_base_dbgs %} | ||
RUN apt-get -y install \ | ||
{% for dbg_pkg in docker_base_dbgs.split(' ') -%} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. No need to keep list of these packages in buildimage since they are not built bu it but installed directly from apt instead There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
What is dbg_pkg for docker-base? #Closed There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. See this pull request. |
||
{{ dbg_pkg }}{{' '}} | ||
{%- endfor %} | ||
{% endif %} | ||
|
||
## Clean up | ||
RUN apt-get clean -y; apt-get autoclean -y; apt-get autoremove -y | ||
## Note: NO removing /var/lib/apt/lists/*, shared by all derived images | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why change this part? /var/lib/apt/lists/ will possibly be obsoleted and there is no benefit to be share then. |
||
## TODO: if it is possible to squash derived images, remove it here | ||
RUN rm -rf /tmp/* |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
Copyright 2016 Microsoft, Inc. | ||
|
||
Licensed under the Apache License, Version 2.0 (the "License"); | ||
you may not use this file except in compliance with the License. | ||
You may obtain a copy of the License at | ||
|
||
http://www.apache.org/licenses/LICENSE-2.0 | ||
|
||
Unless required by applicable law or agreed to in writing, software | ||
distributed under the License is distributed on an "AS IS" BASIS, | ||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
See the License for the specific language governing permissions and | ||
limitations under the License. | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
## Drop unnecessary files | ||
## ref: https://wiki.ubuntu.com/ReducingDiskFootprint | ||
|
||
## Documentation | ||
path-exclude /usr/share/doc/* | ||
# we need to keep copyright files for legal reasons | ||
path-include /usr/share/doc/*/copyright | ||
path-exclude /usr/share/man/* | ||
path-exclude /usr/share/groff/* | ||
path-exclude /usr/share/info/* | ||
# lintian stuff is small, but really unnecessary | ||
path-exclude /usr/share/lintian/* | ||
path-exclude /usr/share/linda/* | ||
|
||
## Translations | ||
path-exclude /usr/share/locale/* | ||
|
||
## Landscape | ||
path-exclude /usr/share/pyshared/twisted/test* | ||
path-exclude /usr/lib/python*/dist-packages/twisted/test* | ||
path-exclude /usr/share/pyshared/twisted/*/test* | ||
path-exclude /usr/lib/python*/dist-packages/twisted/*/test* |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
############################################################################### | ||
# Managed by Ansible | ||
# file: ansible/roles/acs/templates/rsyslog.conf.j2 | ||
############################################################################### | ||
# | ||
# /etc/rsyslog.conf Configuration file for rsyslog. | ||
# | ||
# For more information see | ||
# /usr/share/doc/rsyslog-doc/html/rsyslog_conf.html | ||
|
||
|
||
################# | ||
#### MODULES #### | ||
################# | ||
|
||
$ModLoad imuxsock # provides support for local system logging | ||
#$ModLoad imklog # provides kernel logging support | ||
#$ModLoad immark # provides --MARK-- message capability | ||
|
||
# provides UDP syslog reception | ||
#$ModLoad imudp | ||
#$UDPServerRun 514 | ||
|
||
# provides TCP syslog reception | ||
#$ModLoad imtcp | ||
#$InputTCPServerRun 514 | ||
|
||
|
||
########################### | ||
#### GLOBAL DIRECTIVES #### | ||
########################### | ||
#Set remote syslog server | ||
*.* @127.0.0.1:514 | ||
|
||
# | ||
# Use traditional timestamp format. | ||
# To enable high precision timestamps, comment out the following line. | ||
# | ||
#$ActionFileDefaultTemplate RSYSLOG_TraditionalFileFormat | ||
|
||
# Define a custom template | ||
$template ACSFileFormat,"%TIMESTAMP% %HOSTNAME% %syslogseverity-text:::uppercase% %syslogtag%%msg:::sp-if-no-1st-sp%%msg:::drop-last-lf%\n" | ||
$ActionFileDefaultTemplate ACSFileFormat | ||
|
||
# | ||
# Set the default permissions for all log files. | ||
# | ||
$FileOwner root | ||
$FileGroup adm | ||
$FileCreateMode 0640 | ||
$DirCreateMode 0755 | ||
$Umask 0022 | ||
|
||
# | ||
# Where to place spool and state files | ||
# | ||
$WorkDirectory /var/spool/rsyslog | ||
|
||
# | ||
# Include all config files in /etc/rsyslog.d/ | ||
# | ||
$IncludeConfig /etc/rsyslog.d/*.conf | ||
|
||
|
||
############### | ||
#### RULES #### | ||
############### | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
## Debian mirror on Microsoft Azure | ||
## Ref: http://debian-archive.trafficmanager.net/ | ||
|
||
deb http://debian-archive.trafficmanager.net/debian/ jessie main contrib non-free | ||
deb-src http://debian-archive.trafficmanager.net/debian/ jessie main contrib non-free | ||
deb http://debian-archive.trafficmanager.net/debian-security/ jessie/updates main contrib non-free | ||
deb-src http://debian-archive.trafficmanager.net/debian-security/ jessie/updates main contrib non-free |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Comment is relevant only when debug option is enabled
Move it inside conditional check