Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Minimal root fs for docker. How to make it better?
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Installing Gentoo
View previous topic :: View next topic  
Author Message
jenkler
Apprentice
Apprentice


Joined: 28 Apr 2003
Posts: 215
Location: Sweden - Stockholm

PostPosted: Thu Jun 20, 2019 2:58 pm    Post subject: Minimal root fs for docker. How to make it better? Reply with quote

I want t build a minimal rootfs. This is how far i have come.


Code:

#!/bin/sh

ALSA_CARDS=""
APACHE2_MODULES=""
CFLAGS="-march=corei7 -Os -pipe"
CPU_FLAGS_X86="mmx sse sse2 sse3 ssse3 sse4_1 sse4_2"
CXXFLAGS="${CFLAGS}"
FEATURES="nodoc noinfo noman unmerge-orphans"
LIBREOFFICE_EXTENSIONS=""
LINGUAS="en"
MAKEOPTS="-j9"
USE="
hardened
-ipv6
minimal mmx
nptl nptlonly
sse sse2 sse3 ssse3 sse4_1 sse4_2
threads
-X
"
VIDEO_CARDS=""

export ALSA_CARDS APACHE2_MODULES CFLAGS CPU_FLAGS_X86 CXXFLAGS FEATURES LIBREOFFICE_EXTENSIONS LINGUAS MAKEOPTS VIDEO_CARDS

emerge --info

#USE="$USE make-symlinks -static"
#export USE
#emerge --nodeps --root="busybox" -aqv busybox


# http://wikigentoo.ksiezyc.pl/Optimize_glibc.htm
#cp locale.gen locale.gen.backup
# /etc/locales.build // old glibc userlocales
#chroot.sh: echo "en_US.UTF-8 UTF-8" > locale.gen
USE="$USE -multiarch"
export USE
emerge --nodeps --root="glibc" -aqv glibc

#export USE
#emerge --nodeps --root="combinde2" -aqv baselayout




1. Crap from locales in glibc/usr/share is allways build. I only want UTF8 with english in glibc. How can I minimize more?
2. Is there any ldflags that strip all the compiled code from debug like strip with gcc

All info about getting a minimal system is helpful.

Thanks for tips ;)

edit
L10N="en-US" and LINGUAS="en_US"

Could help... Will try later.

Still need input :p
_________________
This is me: Jenkler IT AB / Jenklermedia, use google translate when viewing my page, please!
Back to top
View user's profile Send private message
Phoenix591
Apprentice
Apprentice


Joined: 17 Sep 2007
Posts: 272

PostPosted: Sat Jun 22, 2019 11:42 am    Post subject: Re: Minimal root fs for docker. How to make it better? Reply with quote

you can set INSTALL_MASK to blacklist specific files/directories you know you don't actually need.

man make.conf(5) wrote:

INSTALL_MASK = [space delimited list of filename patterns (globs)]
Use this variable if you want to selectively prevent certain files from being copied into your file system tree. This does not work on symlinks, but only on actual files (including directories). Useful if you wish to filter out files like HACKING.gz and TODO.gz.
Patterns are matched against both the absolute path and the bare filename of each file (or directory) to be installed.

The INSTALL_MASK is processed just before a package is merged. Also supported is a PKG_INSTALL_MASK variable that behaves exactly like INSTALL_MASK except that it is processed just before creation of a binary package.

***warning***
This does not place nice with filenames containing spaces. If you supply a pattern with a space in it, that single pattern will be interpreted as two separate patterns.

Examples:

# Prevent individual files from being installed.
INSTALL_MASK="/usr/bin/zless /usr/bin/zzxorcat"

# Prevent all PDF files from being installed.
INSTALL_MASK="*.pdf"

# Block PDF files one level beneath /usr/share/doc.
INSTALL_MASK="/usr/share/doc/*/*.pdf"

# Watch out! This will be interpreted as two patterns, and
# prevent both "README" AND all PDF files from being installed.
INSTALL_MASK="README\ *.pdf"
Back to top
View user's profile Send private message
jenkler
Apprentice
Apprentice


Joined: 28 Apr 2003
Posts: 215
Location: Sweden - Stockholm

PostPosted: Sat Jun 22, 2019 12:33 pm    Post subject: Reply with quote

Thanks, I will try this out!

All tips are so welcome ;)
_________________
This is me: Jenkler IT AB / Jenklermedia, use google translate when viewing my page, please!
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Installing Gentoo All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum