github.com/apptainer/singularity@v3.1.1+incompatible/examples/legacy/2.2/arch.def (about)

     1  # Copyright (c) 2016, Maciej Sieczka. All rights reserved
     2  #
     3  # Minimal installation process is defined in mods/linux_build_arch.smod. A
     4  # couple extra actions are called from here using RunCmd and InstallPkgs
     5  # Singularity bootstrap keywords. Adjust them as needed.
     6  # https://wiki.archlinux.org/index.php/Installation_Guide may come in handy.
     7  
     8  DistType "arch"
     9  
    10  # "Setup" keyword doesn't do anything anymore, at least as of Singularity
    11  # 2.1.2. Undocumented "PreSetup" replaced it and is called at each
    12  # `singularity bootstrap' run.
    13  # Setup
    14  
    15  Bootstrap
    16  
    17  # Set time zone. Use whatever you prefer instead of UTC.
    18  RunCmd ln -s /usr/share/zoneinfo/UTC /etc/localtime
    19  
    20  # WARNING: Make sure you prefix the STDOUT redirection target (ie. that guy
    21  # after `>' or `>>`) with $SINGULARITY_BUILD_ROOT in RunCmd calls, as below.
    22  # Otherwise such command will write to host's filesystem, at least as of
    23  # Singularity 2.1.2! This is a known issue, going to be fixed. See
    24  # https://github.com/gmkurtzer/singularity/issues/200.
    25  
    26  # Set locale. Use whatever you prefer instead of en_US.
    27  RunCmd echo 'en_US.UTF-8 UTF-8' > "$SINGULARITY_BUILD_ROOT"/etc/locale.gen
    28  # Add more locales as needed, eg:
    29  # RunCmd echo 'pl_PL.UTF-8 UTF-8' >> "$SINGULARITY_BUILD_ROOT"/etc/locale.gen
    30  RunCmd locale-gen
    31  RunCmd echo 'LANG=en_US.UTF-8' > "$SINGULARITY_BUILD_ROOT"/etc/locale.conf
    32  # Mind that Singularity's shell will use host's locale no matter what anyway,
    33  # as of version 2.1.2. This may change in a future release.
    34  
    35  # Set the package mirror server(s). This is only for the output image's
    36  # mirrorlist. `pacstrap' can only use your hosts's package mirrors.
    37  RunCmd echo 'Server = https://mirrors.kernel.org/archlinux/$repo/os/$arch' > "$SINGULARITY_BUILD_ROOT"/etc/pacman.d/mirrorlist
    38  # Add any number of fail-over servers, eg:
    39  RunCmd echo 'Server = https://archlinux.honkgong.info/$repo/os/$arch' >> "$SINGULARITY_BUILD_ROOT"/etc/pacman.d/mirrorlist
    40  
    41  # I need VIM and Bash completion. Specify your extra packages as needed.
    42  InstallPkgs vim bash-completion
    43  
    44  # Remove the packages downloaded to image's Pacman cache dir during
    45  # InstallPkgs. BTW, `pacstrap', used in Bootstrap step, uses host's package
    46  # cache rather than the image's.
    47  RunCmd paccache -r -k0
    48  
    49  Cleanup
    50  =======
    51  # Copyright (c) 2015-2017, Gregory M. Kurtzer. All rights reserved.
    52  #
    53  # "Singularity" Copyright (c) 2016, The Regents of the University of California,
    54  # through Lawrence Berkeley National Laboratory (subject to receipt of any
    55  # required approvals from the U.S. Dept. of Energy).  All rights reserved.
    56  #
    57  
    58  # Minimal installation process is defined in
    59  # libexec/bootstrap/modules-v2/dist-arch.sh. A couple extra actions are called
    60  # from here in '%post' section. Adjust them as needed.
    61  # https://wiki.archlinux.org/index.php/Installation_Guide may come in handy.
    62  
    63  BootStrap: arch
    64  
    65  %runscript
    66      echo "This is what happens when you run the container..."
    67  
    68  %post
    69      echo "Hello from inside the container"
    70  
    71      # Set time zone. Use whatever you prefer instead of UTC.
    72      ln -s /usr/share/zoneinfo/UTC /etc/localtime
    73  
    74      # Set locale. Use whatever you prefer instead of en_US.
    75      echo 'en_US.UTF-8 UTF-8' > /etc/locale.gen
    76      # Add more locales as needed, eg:
    77      # echo 'pl_PL.UTF-8 UTF-8' >> /etc/locale.gen
    78      locale-gen
    79      echo 'LANG=en_US.UTF-8' > /etc/locale.conf
    80      # Mind that Singularity's shell will use host's locale no matter what
    81      # anyway, as of version 2.1.2. This may change in a future release.
    82  
    83      # Set the package mirror server(s). This is only for the output image's
    84      # mirrorlist. `pacstrap' can only use your hosts's package mirrors.
    85      echo 'Server = https://mirrors.kernel.org/archlinux/$repo/os/$arch' > /etc/pacman.d/mirrorlist
    86      # Add any number of fail-over servers, eg:
    87      echo 'Server = https://archlinux.honkgong.info/$repo/os/$arch' >> /etc/pacman.d/mirrorlist
    88  
    89      # I need VIM and Bash completion. Specify your extra packages as needed.
    90      pacman -Sy --noconfirm vim bash-completion
    91  
    92      # Remove the packages downloaded to image's Pacman cache dir.
    93      paccache -r -k0