diff --git a/Dockerfile b/Dockerfile index 9f11d980f..3bb38bc00 100644 --- a/Dockerfile +++ b/Dockerfile @@ -9,7 +9,7 @@ RUN dnf -y install vim sudo tmux zsh moreutils make moreutils sudo \ initscripts openssh man-db ncurses-compat-libs wget curl \ libcurl-devel pcre-devel bzip2-devel rsync zlib-devel \ pkgconfig w3m openssl-devel gcc rubygem-rake fpaste \ - zip unzip psmisc lsof python yum-plugin-ovl + zip unzip psmisc lsof python yum-plugin-ovl glibc-all-langpacks # Specifically needed packages, with versions where the package is # important. diff --git a/README b/README index 48dd0e326..c8babd4fa 100644 --- a/README +++ b/README @@ -1,7 +1,33 @@ +Requirements +------------ + +All you need is Docker ( +https://docs.docker.com/install/#supported-platforms ) or podman ( +https://podman.io/getting-started/installation ) and some means of +running bash scripts. This means you can run this on a MacOS box, +even though it's very much a Linux build process. Windows should +also be possible, albeit with some difficulty (because you have to +get bash). + +You really need at least 2GiB of free RAM; Prince will swap like +crazy otherwise. + +The builds will run in a podman (preferred) or docker container, +depending on what you have available. + +Usage +----- + To make all the versions do: ./run_container.sh +Note that this takes a while, proportionate to available CPU; on an +AWS t2.micro I gave up after over 2 hours due to it running out of +RAM. On an AWS t2.medium it took about an hour. RAM is a +significant consideration; it needs at least 2GiB free (and possibly +more). + The final results will end up under the build/ directory, scattered about in various places. If you would like the final outputs only to be copied to another directory, i.e. for web display, you can use @@ -32,13 +58,3 @@ with -T, such as: You can get a complete list of targets via: ./run_container.sh -h - -Container/sudo Notes --------------------- - -The builds will run in a podman (preferred) or docker container, -depending on what you have available. - -All container commands are run with sudo. This is a pretty standard -requirement for container use; if it causes you problems let me -(rlpowell) know and we'll try to figure something out. diff --git a/cll_build b/cll_build index 72d70b439..b81b9b954 100755 --- a/cll_build +++ b/cll_build @@ -1,5 +1,20 @@ #!/bin/bash +export LANG=en_US.UTF-8 +export LC_CTYPE="en_US.UTF-8" +export LC_NUMERIC="en_US.UTF-8" +export LC_TIME="en_US.UTF-8" +export LC_COLLATE=C +export LC_MONETARY="en_US.UTF-8" +export LC_MESSAGES="en_US.UTF-8" +export LC_PAPER="en_US.UTF-8" +export LC_NAME="en_US.UTF-8" +export LC_ADDRESS="en_US.UTF-8" +export LC_TELEPHONE="en_US.UTF-8" +export LC_MEASUREMENT="en_US.UTF-8" +export LC_IDENTIFICATION="en_US.UTF-8" +export LC_ALL= + # Find and go to where the script lives sdir="$(dirname "$(readlink -f $0)")" cd "$sdir" diff --git a/run_container.sh b/run_container.sh index 5c767d259..016eddb2b 100755 --- a/run_container.sh +++ b/run_container.sh @@ -3,14 +3,16 @@ CONTAINER_BIN=${CONTAINER_BIN:-$(which podman 2>/dev/null)} CONTAINER_BIN=${CONTAINER_BIN:-$(which docker 2>/dev/null)} -if $CONTAINER_BIN info >/dev/null 2>&1 +# Try sudo first because systems where everything is working without +# sudo are less likely +if sudo $CONTAINER_BIN info >/dev/null 2>&1 then - # Everything is working; no-op - CONTAINER_BIN="$CONTAINER_BIN" + CONTAINER_BIN="sudo $CONTAINER_BIN" else - if sudo $CONTAINER_BIN info >/dev/null 2>&1 + if $CONTAINER_BIN info >/dev/null 2>&1 then - CONTAINER_BIN="sudo $CONTAINER_BIN" + # Everything is working; no-op + CONTAINER_BIN="$CONTAINER_BIN" else echo "I can't get a working container system. You need to either have podman (preferred) or docker installed and running for this build system to work. I have tried both \"podman info\" and \"docker info\", with and without sudo." exit 1 @@ -42,7 +44,7 @@ $CONTAINER_BIN rm cll_build >/dev/null 2>&1 dir=$(readlink -f $(dirname $0)) # If SELinux is on -if getenforce | grep -q Enforcing +if which getenforce >/dev/null 2>&1 && getenforce | grep -q Enforcing then # Make it accessible to both the user and the container chcon -R -t container_home_t . "${extra_dirs[@]}" @@ -68,6 +70,6 @@ $CONTAINER_BIN build -t lojban/cll_build -f Dockerfile . >/tmp/rc.$$ 2>&1 || { rm -f /tmp/rc.$$ -$CONTAINER_BIN run --name cll_build --log-driver syslog --log-opt tag=cll_build \ +$CONTAINER_BIN run --name cll_build \ -v $dir:/srv/cll "${extra_vols[@]}" -it lojban/cll_build \ /tmp/container_init.sh "$(id -u)" "$(id -g)" "${args[@]}"