Skip to content

Commit

Permalink
Minor build fixes from testing on Ubuntu.
Browse files Browse the repository at this point in the history
  • Loading branch information
rlpowell committed Dec 15, 2019
1 parent cf5c76a commit 92b3e6f
Show file tree
Hide file tree
Showing 4 changed files with 51 additions and 18 deletions.
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
36 changes: 26 additions & 10 deletions README
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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.
15 changes: 15 additions & 0 deletions cll_build
Original file line number Diff line number Diff line change
@@ -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"
Expand Down
16 changes: 9 additions & 7 deletions run_container.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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[@]}"
Expand All @@ -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[@]}"

0 comments on commit 92b3e6f

Please sign in to comment.