Sign inSign up

c5766/ms4

By c5766

•Updated about 9 years ago

my stage4

Image
0

1.4K

c5766/ms4 repository overview

  • Dockerfile

** publishing

publishing
place the cursor inside the source block
C-u C-c C-v t

** tag

| tag | git commands | |--------+----------------------------------| | add | | | | git tag -a | | | | | | git tag -m | | | | | | git tag -a -m | | | | | | M-x magit-tag | |--------+----------------------------------| | push | | | | git push origin tag_name | | | | | | magit push a tag | |--------+----------------------------------| | remove | | | | git push origin :tagname | | | | | | git push --delete origin tagname | | | | | | git tag --delete tagname |

** gentoo/stage3-amd64-hardened Dockerfile

https://hub.docker.com/r/gentoo/stage3-amd64-hardened/~/dockerfile/⁠

FROM busybox

MAINTAINER Gentoo Docker Team

⁠This one should be present by running the build.sh script

ADD build.sh /

RUN /build.sh amd64 x86_64 -hardened

⁠Setup the rc_sys

RUN sed -e 's/#rc_sys=""/rc_sys="docker"/g' -i /etc/rc.conf

⁠By default, UTC system

RUN echo 'UTC' > /etc/timezone

** v.10

adjust build.sh

download and unable to build without privileged operations

docker build should support privileged operations #1916

https://github.com/moby/moby/issues/1916⁠

** v.9

mkdir -p /root/catalyst/tmp/hardened

⁠error

2017-08-10 02:02:50 (52.4 MB/s) - '/root/catalyst/builds/default/stage3.spec' saved [240/240]

 Catalyst, version 2.0.18 Copyright 2003-2008 Gentoo Foundation Copyright 2008-2012 various authors Distributed under the GNU General Public License version 2.1

Using command line specified Catalyst configuration file, /root/catalyst.conf Setting sharedir to config file value "/usr/lib64/catalyst" Setting snapshot_cache to config file value "/var/tmp/catalyst/snapshot_cache" Setting hash_function to config file value "crc32" Setting storedir to config file value "/root/catalyst" Setting portdir to config file value "/usr/portage" Setting distdir to config file value "/usr/portage/distfiles" Setting options to config file value "autoresume bindist kerncache pkgcache seedcache snapcache" Autoresuming support enabled. Binary redistribution enabled Kernel cache support enabled. Package cache support enabled. Seed cache support enabled. Snapshot cache support enabled. Envscript support enabled. Using target: stage1 Building natively for amd64 stage1 root path is /tmp/stage1root Source path set to /root/catalyst/builds/hardened/stage3-amd64-hardened-latest.tar.bz2 Caching snapshot to /var/tmp/catalyst/snapshot_cache/latest/ The autoresume path is /root/catalyst/tmp/hardened/.autoresume-stage1-amd64-hardened-latest/ stage1 stage path is /root/catalyst/tmp/hardened/stage1-amd64-hardened-latest/tmp/stage1root Location of the package cache is /root/catalyst/packages/hardened/stage1-amd64-hardened-latest/ Location of the kerncache is /root/catalyst/kerncache/hardened/stage1-amd64-hardened-latest/ Checking for processes running in chroot and killing them.

--- Running action sequence: unpack

Referenced SEEDCACHE does not appear to be a directory, trying to untar... No Valid Resume point detected, cleaning up... Removing AutoResume Points: ... Emptying directory /root/catalyst/tmp/hardened/.autoresume-stage1-amd64-hardened-latest/ Emptying directory /root/catalyst/tmp/hardened/stage1-amd64-hardened-latest/

Starting tar extract from /root/catalyst/builds/hardened/stage3-amd64-hardened-latest.tar.bz2 to /root/catalyst/tmp/hardened/stage1-amd64-hardened-latest/ (This may take some time) ...

tar: SELinux support is not available  --- Running action sequence: unpack_snapshot

Cleaning up invalid snapshot cache at /var/tmp/catalyst/snapshot_cache/latest/ (This can take a long time)...

Unpacking portage tree (This can take a long time) ...

tar: SELinux support is not available  lockfile does not exist '/var/tmp/catalyst/snapshot_cache/latest/.catalyst_lock' --- Running action sequence: setup_confdir --- Running action sequence: portage_overlay --- Running action sequence: base_dirs --- Running action sequence: bind

mount: permission denied 

!!! catalyst: Couldn't bind mount /proc

** v.8

#+HEADER: :tangle Dockerfile #+BEGIN_SRC sh FROM c5766/gentoo-catalyst:v.2

ADD build.sh /

RUN /build.sh #+END_SRC

| publishing the above block | | C-u C-c C-v t | | | | M-x magit-tag | | | | git push master | | | | git push a tag | | | | observing autmoated build |

Catalyst, version 2.0.18 Copyright 2003-2008 Gentoo Foundation Copyright 2008-2012 various authors Distributed under the GNU General Public License version 2.1

Using command line specified Catalyst configuration file, /root/catalyst.conf Setting sharedir to config file value "/usr/lib64/catalyst" Setting snapshot_cache to config file value "/var/tmp/catalyst/snapshot_cache" Setting hash_function to config file value "crc32" Setting storedir to config file value "/root/catalyst" Setting portdir to config file value "/usr/portage" Setting distdir to config file value "/usr/portage/distfiles" Setting options to config file value "autoresume bindist kerncache pkgcache seedcache snapcache" Autoresuming support enabled. Binary redistribution enabled Kernel cache support enabled. Package cache support enabled. Seed cache support enabled. Snapshot cache support enabled. Envscript support enabled. Using target: stage1 Building natively for amd64 stage1 root path is /tmp/stage1root Source path set to /root/catalyst/builds/hardened/stage3-amd64-hardened-latest.tar.bz2 Caching snapshot to /var/tmp/catalyst/snapshot_cache/latest/ The autoresume path is /root/catalyst/tmp/hardened/.autoresume-stage1-amd64-hardened-latest/ stage1 stage path is /root/catalyst/tmp/hardened/stage1-amd64-hardened-latest/tmp/stage1root Location of the package cache is /root/catalyst/packages/hardened/stage1-amd64-hardened-latest/ Location of the kerncache is /root/catalyst/kerncache/hardened/stage1-amd64-hardened-latest/ Checking for processes running in chroot and killing them.

--- Running action sequence: unpack

Referenced SEEDCACHE does not appear to be a directory, trying to untar... No Valid Resume point detected, cleaning up... Removing AutoResume Points: ... Emptying directory /root/catalyst/tmp/hardened/.autoresume-stage1-amd64-hardened-latest/ Emptying directory /root/catalyst/tmp/hardened/stage1-amd64-hardened-latest/

Starting tar extract from /root/catalyst/builds/hardened/stage3-amd64-hardened-latest.tar.bz2 to /root/catalyst/tmp/hardened/stage1-amd64-hardened-latest/ (This may take some time) ...

tar: SELinux support is not available  tar: ./bin: Directory renamed before its status could be extracted tar: Exiting with failure status due to previous errors 

!!! catalyst: Tarball extraction of /root/catalyst/builds/hardened/stage3-amd64-hardened-latest.tar.bz2 to /root/catalyst/tmp/hardened/stage1-amd64-hardened-latest/ failed.

** v.7 adjust snapshot_cache

/root/catalyst/snapshots

⁠errors

Catalyst, version 2.0.18 Copyright 2003-2008 Gentoo Foundation Copyright 2008-2012 various authors Distributed under the GNU General Public License version 2.1

Using command line specified Catalyst configuration file, /root/catalyst.conf Setting sharedir to config file value "/usr/lib64/catalyst" Setting snapshot_cache to config file value "/var/tmp/catalyst/snapshot_cache" Setting hash_function to config file value "crc32" Setting storedir to config file value "/root/catalyst" Setting portdir to config file value "/usr/portage" Setting distdir to config file value "/usr/portage/distfiles" Setting options to config file value "autoresume bindist kerncache pkgcache seedcache snapcache" Autoresuming support enabled. Binary redistribution enabled Kernel cache support enabled. Package cache support enabled. Seed cache support enabled. Snapshot cache support enabled. Envscript support enabled. Using target: stage1 Building natively for amd64 stage1 root path is /tmp/stage1root Source path set to /root/catalyst/builds/hardened/stage3-amd64-hardened-latest.tar.bz2 Caching snapshot to /var/tmp/catalyst/snapshot_cache/latest/ The autoresume path is /root/catalyst/tmp/hardened/.autoresume-stage1-amd64-hardened-latest/ stage1 stage path is /root/catalyst/tmp/hardened/stage1-amd64-hardened-latest/tmp/stage1root

!!! catalyst: Cannot locate specified distdir: /usr/portage/distfiles

** v.6 adjust snapshot_cache

/var/tmp/catalyst/snapshot_cache

⁠errors

Catalyst, version 2.0.18 Copyright 2003-2008 Gentoo Foundation Copyright 2008-2012 various authors Distributed under the GNU General Public License version 2.1

Using command line specified Catalyst configuration file, /root/catalyst.conf Setting sharedir to config file value "/usr/lib64/catalyst" Setting snapshot_cache to config file value "/var/tmp/catalyst/snapshot_cache" Setting hash_function to config file value "crc32" Setting storedir to config file value "/root/catalyst" Setting portdir to config file value "/usr/portage" Setting distdir to config file value "/usr/portage/distfiles" Setting options to config file value "autoresume bindist kerncache pkgcache seedcache snapcache" Autoresuming support enabled. Binary redistribution enabled Kernel cache support enabled. Package cache support enabled. Seed cache support enabled. Snapshot cache support enabled. Envscript support enabled. Using target: stage1 Building natively for amd64 stage1 root path is /tmp/stage1root Source path set to /root/catalyst/builds/hardened/stage3-amd64-hardened-latest.tar.bz2 Caching snapshot to /var/tmp/catalyst/snapshot_cache/latest/ The autoresume path is /root/catalyst/tmp/hardened/.autoresume-stage1-amd64-hardened-latest/ stage1 stage path is /root/catalyst/tmp/hardened/stage1-amd64-hardened-latest/tmp/stage1root

!!! catalyst: Cannot locate specified snapshot_path: /root/catalyst/snapshots/portage-latest.tar.bz2

** v.5 adjust the directory to store snapshot

| | the directory to store snaopshot | |-----+----------------------------------| | v.4 | /root/catalyst/snapshots | | | | | v.5 | /var/tmp/catalyst/snapshots/ |

** v.4

#+HEADER: :tangle Dockerfile #+BEGIN_SRC sh FROM c5766/gentoo-catalyst

ADD build.sh /

RUN /build.sh #+END_SRC

| publishing the above block | | C-u C-c C-v t | | | | M-x magit-tag | | | | git push master | | | | git push a tag | | | | observing autmoated build |

⁠test 1

d="/tmp/test"

mkdir $d

cd $d

f1="https://raw.githubusercontent.com/cmchaol/ms4/master/Dockerfile⁠"

f2="https://github.com/cmchaol/ms4/blob/master/build.sh⁠"

wget $f1

wget $f2

chmod +x build.sh

https://docs.docker.com/engine/reference/commandline/build/#git-repositories⁠

⁠test 2

cd $d

u="https://github.com/cmchaol/ms4.git⁠"

docker build $u

** v.3

#+HEADER: :tangle Dockerfile #+BEGIN_SRC sh FROM c5766/gentoo-catalyst:v.2

RUN cd /usr/portage;
rm -rf ls -1A | grep -vP '^profiles' #+END_SRC

| publishing the above block | | C-u C-c C-v t | | | | M-x magit-tag | | | | git push master | | | | git push a tag | | | | observing autmoated build |

** v.2

#+HEADER: :tangle Dockerfile #+BEGIN_SRC sh FROM c5766/gentoo-catalyst:v.2 #+END_SRC

| publishing the above block | | | | M-x magit-tag-popup | | | | git push | | | | observing autmoated build | | |

** v.1

#+HEADER: :tangle Dockerfile #+BEGIN_SRC sh FROM c5766/gentoo-catalyst:v2 #+END_SRC

Build failed: manifest for c5766/gentoo-catalyst:v2 not found

  • debug

** c5766/gentoo-catalyst

docker run --cap-add SYS_ADMIN -it c5766/gentoo-catalyst /bin/bash

** catalyst.conf

f1="/etc/catalyst/catalyst.conf"

cat $f1

⁠/etc/catalyst/catalyst.conf

⁠Simple desriptions of catalyst settings. Please refer to the online

⁠documentation for more information.

⁠Creates a .DIGESTS file containing the hash output from any of the supported

⁠options below. Adding them all may take a long time.

⁠Supported hashes:

⁠adler32, crc32, crc32b, gost, haval128, haval160, haval192, haval224,

⁠haval256, md2, md4, md5, ripemd128, ripemd160, ripemd256, ripemd320, sha1,

⁠sha224, sha256, sha384, sha512, snefru128, snefru256, tiger, tiger128,

⁠tiger160, whirlpool

digests="md5 sha1 sha512 whirlpool"

⁠Creates a .CONTENTS file listing the contents of the file. Pick from any of

⁠the supported options below:

⁠tar-tv - does 'tar tvf FILE'

⁠tar-tvz - does 'tar tvzf FILE'

⁠tar-tvy - does 'tar tvyf FILE'

⁠isoinfo-l - does 'isoinfo -l -i FILE'

⁠isoinfo-f - does 'isoinfo -f -i FILE'

⁠'isoinfo-f' is the only option not chosen by the automatic algorithm.

⁠If this variable is empty, no .CONTENTS will be generated at all.

contents="auto"

⁠distdir specifies where your distfiles are located. This setting should

⁠work fine for most default installations.

distdir="/usr/portage/distfiles"

⁠envscript allows users to set options such as http proxies, MAKEOPTS,

⁠GENTOO_MIRRORS, or any other environment variables needed for building.

⁠The envscript file sets environment variables like so:

⁠export FOO="bar"

envscript="/etc/catalyst/catalystrc"

⁠Internal hash function catalyst should use for things like autoresume,

⁠seedcache, etc. The default and fastest is crc32. You should not ever need

⁠to change this unless your OS does not support it.

⁠Supported hashes:

⁠adler32, crc32, crc32b, gost, haval128, haval160, haval192, haval224,

⁠haval256, md2, md4, md5, ripemd128, ripemd160, ripemd256, ripemd320, sha1,

⁠sha224, sha256, sha384, sha512, snefru128, snefru256, tiger, tiger128,

⁠tiger160, whirlpool

hash_function="crc32"

⁠options set different build-time options for catalyst. Some examples are:

⁠autoresume = Attempt to resume a failed build, clear the autoresume flags with

⁠the -a option to the catalyst cmdline. -p will clear the autoresume flags

⁠as well as your pkgcache and kerncache

⁠( This option is not fully tested, bug reports welcome )

⁠bindist = enables the bindist USE flag, please see package specific definition,

⁠however, it is suggested to enable this if redistributing builds.

⁠ccache = enables build time ccache support

⁠distcc = enable distcc support for building. You have to set distcc_hosts in

⁠your spec file.

⁠icecream = enables icecream compiler cluster support for building

⁠kerncache = keeps a tbz2 of your built kernel and modules (useful if your

⁠build stops in livecd-stage2)

⁠pkgcache = keeps a tbz2 of every built package (useful if your build stops

⁠prematurely)

⁠preserve_libs = enables portage to preserve used libs when unmerging packages

⁠(used on installcd-stage2 and stage4 targets)

⁠seedcache = use the build output of a previous target if it exists to speed up

⁠the copy

⁠snapcache = cache the snapshot so that it can be bind-mounted into the chroot.

⁠WARNING: moving parts of the portage tree from within fsscript will break

⁠your cache. The cache is unlinked before any empty or rm processing, though.

⁠(These options can be used together)

options="autoresume bindist kerncache pkgcache seedcache snapcache"

⁠portdir specifies the source portage tree used by the snapshot target.

portdir="/usr/portage"

⁠sharedir specifies where all of the catalyst runtime executables are. Most

⁠users do not need to change this.

sharedir="/usr/lib64/catalyst"

⁠snapshot_cache specifies where the snapshots will be cached to if snapcache is

⁠enabled in the options.

snapshot_cache="/var/tmp/catalyst/snapshot_cache"

⁠storedir specifies where catalyst will store everything that it builds, and

⁠also where it will put its temporary files and caches.

storedir="/var/tmp/catalyst"

⁠port_logdir is where all build logs will be kept. This dir will be automatically cleaned

⁠of all logs over 30 days old. If left undefined the logs will remain in the build directory

⁠as usual and get cleaned every time a stage build is restarted.

⁠port_logdir="/var/tmp/catalyst/tmp"

⁠var_tmpfs_portage will mount a tmpfs for /var/tmp/portage so building takes place in RAM

⁠this feature requires a pretty large tmpfs ({open,libre}office needs ~8GB to build)

⁠WARNING: If you use too much RAM everything will fail horribly and it is not our fault.

⁠set size of /var/tmp/portage tmpfs in gigabytes

⁠var_tmpfs_portage=16

  • reference

https://github.com/cmchaol/ms4⁠

https://hub.docker.com/r/pallavagarwal07/gentoo-stabilization/~/dockerfile/⁠

Tag summary

Content type

Image

Digest

Size

676.8 MB

Last updated

about 9 years ago

docker pull c5766/ms4