diff options
author | Mark Wong <markwkm@gmail.com> | 2022-12-07 20:29:16 -0800 |
---|---|---|
committer | Mark Wong <markwkm@gmail.com> | 2022-12-08 11:09:15 -0800 |
commit | 4e76c4e56619eec16977f421257b72a20e0df5a2 (patch) | |
tree | 44960be4b60b54541a7c4092fb3d6f81ebd9d741 | |
parent | 3e9715605b47570ec24e6a5679f2dc31c264f9e4 (diff) |
podman switch
Also update files to use CentOS 7, as CentOS 6 is not functioning. It's
not clear whether it's because of switching to podman or because CentOS
6 simply isn't able to function in a container under some of the newer
Linux systems.
-rw-r--r-- | .containerfileignore | 12 | ||||
-rw-r--r-- | CMakeLists.txt | 2 | ||||
-rw-r--r-- | Containerfile.appimage | 45 | ||||
-rw-r--r-- | Dockerfile.appimage | 48 | ||||
-rw-r--r-- | HISTORY.rst | 2 | ||||
-rw-r--r-- | Makefile | 4 | ||||
-rw-r--r-- | container/README | 4 | ||||
-rwxr-xr-x | container/appimage-build | 19 | ||||
-rwxr-xr-x | container/appimage-prepare | 13 | ||||
-rw-r--r-- | docker/README | 4 | ||||
-rwxr-xr-x | docker/appimage-build | 26 | ||||
-rwxr-xr-x | docker/appimage-prepare | 14 |
12 files changed, 97 insertions, 96 deletions
diff --git a/.containerfileignore b/.containerfileignore new file mode 100644 index 0000000..2a3018d --- /dev/null +++ b/.containerfileignore @@ -0,0 +1,12 @@ +**/*.sw? + +build/ +cmake_install.cmake +CMakeCache.txt +container/** +Containerfile* +.containerignore +.git +.gitignore +install_manifest.txt +.vscode diff --git a/CMakeLists.txt b/CMakeLists.txt index d70551c..6478991 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -396,7 +396,7 @@ add_custom_target(appimage COMMAND VERSION=${PROJECT_VERSION} appimagetool-${ARCH}.AppImage AppDir ) -add_custom_target(appimage-docker +add_custom_target(appimage-podman COMMAND cp -aL ${CMAKE_SOURCE_DIR}/AppRun AppDir COMMAND cp -aL ${CMAKE_SOURCE_DIR}/pg_top.desktop AppDir COMMAND cp -aL ${CMAKE_SOURCE_DIR}/pg_top.png AppDir diff --git a/Containerfile.appimage b/Containerfile.appimage new file mode 100644 index 0000000..5646039 --- /dev/null +++ b/Containerfile.appimage @@ -0,0 +1,45 @@ +# Build an environment for creating an AppImage. + +# Use a distro with an old libc to maximize support on as many linux distros as +# possible. +FROM centos:7 + +RUN yum -y update && \ + yum -y install epel-release && \ + yum -y update && \ + yum -y install bison \ + bzip2 \ + cmake \ + file \ + flex \ + gcc \ + libbsd-devel \ + make \ + ncurses-devel \ + openssl-devel \ + xz && \ + yum -y clean all + +WORKDIR /usr/local +# Release 12 is the latest that will run on CentOS 6. +RUN curl -OL https://github.com/AppImage/AppImageKit/releases/download/12/appimagetool-x86_64.AppImage && \ + chmod +x appimagetool-x86_64.AppImage && \ + ./appimagetool-x86_64.AppImage --appimage-extract && \ + chmod 0755 squashfs-root && \ + chmod 0755 squashfs-root/usr && \ + chmod 0755 squashfs-root/usr/bin && \ + chmod 0755 squashfs-root/usr/lib && \ + chmod 0755 squashfs-root/usr/lib/appimagekit && \ + chmod 0755 squashfs-root/usr/share + +WORKDIR /usr/local/src + +# PostgreSQL 10 is the first release supporting multiple hosts in the +# connection string. +RUN curl -OL https://ftp.postgresql.org/pub/source/v10.17/postgresql-10.17.tar.bz2 +RUN tar xvf postgresql-10.17.tar.bz2 +WORKDIR /usr/local/src/postgresql-10.17 +RUN ./configure --without-ldap --without-readline --without-zlib \ + --without-gssapi --with-openssl --prefix=/usr +RUN make install +RUN ldconfig diff --git a/Dockerfile.appimage b/Dockerfile.appimage deleted file mode 100644 index dd7a460..0000000 --- a/Dockerfile.appimage +++ /dev/null @@ -1,48 +0,0 @@ -# Build an environment for creating an AppImage. - -# Use a distro with an old libc to maximize support on as many linux distros as -# possible. -FROM centos:6 - -# CentOS 6 is EOL so update the repo config to use the CentOS vault. 6.10 is -# the final version. -RUN sed -i 's/enabled=1/enabled=0/' /etc/yum/pluginconf.d/fastestmirror.conf -RUN sed -i 's/mirrorlist/#mirrorlist/' /etc/yum.repos.d/*.repo -RUN sed -i 's|#baseurl=http://mirror.centos.org/centos/$releasever|baseurl=https://vault.centos.org/6.10|' /etc/yum.repos.d/*.repo - -RUN yum -y update -RUN yum -y install epel-release -RUN yum -y update -RUN yum -y install cmake \ - bison \ - flex \ - gcc \ - libbsd-devel \ - make \ - ncurses-devel \ - openssl-devel \ - xz - -WORKDIR /usr/local -# Release 12 is the latest that will run on CentOS 6. -RUN curl -OL https://github.com/AppImage/AppImageKit/releases/download/12/appimagetool-x86_64.AppImage -RUN chmod +x appimagetool-x86_64.AppImage -RUN ./appimagetool-x86_64.AppImage --appimage-extract -RUN chmod 0755 squashfs-root -RUN chmod 0755 squashfs-root/usr -RUN chmod 0755 squashfs-root/usr/bin -RUN chmod 0755 squashfs-root/usr/lib -RUN chmod 0755 squashfs-root/usr/lib/appimagekit -RUN chmod 0755 squashfs-root/usr/share - -WORKDIR /usr/local/src - -# PostgreSQL 10 is the first release supporting multiple hosts in the -# connection string. -RUN curl -OL https://ftp.postgresql.org/pub/source/v10.17/postgresql-10.17.tar.bz2 -RUN tar xvf postgresql-10.17.tar.bz2 -WORKDIR /usr/local/src/postgresql-10.17 -RUN ./configure --without-ldap --without-readline --without-zlib \ - --without-gssapi --with-openssl --prefix=/usr -RUN make install -RUN ldconfig diff --git a/HISTORY.rst b/HISTORY.rst index 07500f0..a96f683 100644 --- a/HISTORY.rst +++ b/HISTORY.rst @@ -4,8 +4,8 @@ Release Notes YYYY-MM-DD v4.0.1 ----------------- -* Add Docker files for creating an AppImage * Set CMake minimum version to 2.8.12 +* Add container files for creating an AppImage 2020-08-05 v4.0.0 ----------------- @@ -12,8 +12,8 @@ appimage-prep: appimage: appimage-prep cd build/appimage && make appimage -appimage-docker: appimage-prep - cd build/appimage && make appimage-docker +appimage-podman: appimage-prep + cd build/appimage && make appimage-podman clean: -rm -rf build diff --git a/container/README b/container/README new file mode 100644 index 0000000..fec16ca --- /dev/null +++ b/container/README @@ -0,0 +1,4 @@ +This is a collection of scripts to use Podman for specific tasks: + +* appimage-prepare - Build a container image to use for creating an AppImage. +* appimage-build - Create an AppImage for pg_top. diff --git a/container/appimage-build b/container/appimage-build new file mode 100755 index 0000000..798d1e0 --- /dev/null +++ b/container/appimage-build @@ -0,0 +1,19 @@ +#!/bin/sh + +if ! which podman > /dev/null 2>&1; then + echo "podman is not in your path" + exit 1 +fi + +CONTAINER_DIR=$(readlink -f "$(dirname "$0")") +CONTAINER_TAG="pg_top-appimage" + +# Use the return code from `podman inspect` to determine if the container image +# needs to be created. +if ! podman inspect $CONTAINER_TAG > /dev/null 2>&1; then + "${CONTAINER_DIR}/appimage-prepare" || exit 1 +fi + +podman run --rm -v "${CONTAINER_DIR}/..:/usr/local/src/pg_top:rw" \ + -w /usr/local/src/pg_top $CONTAINER_TAG \ + make appimage-podman diff --git a/container/appimage-prepare b/container/appimage-prepare new file mode 100755 index 0000000..aad8275 --- /dev/null +++ b/container/appimage-prepare @@ -0,0 +1,13 @@ +#!/bin/sh + +if ! which podman > /dev/null 2>&1; then + echo "podman is not in your path" + exit 1 +fi + +CONTAINER_DIR=$(readlink -f "$(dirname "$0")") +CONTAINER_TAG="pg_top-appimage" + +cd "$CONTAINER_DIR/.." && \ + podman build --isolation=chroot -t $CONTAINER_TAG \ + -f Containerfile.appimage . diff --git a/docker/README b/docker/README deleted file mode 100644 index 3f6947e..0000000 --- a/docker/README +++ /dev/null @@ -1,4 +0,0 @@ -This is a collection of scripts to use Docker for specific tasks: - -* appimage-prepare - Build a Docker image to use for creating an AppImage. -* appimage-build - Create an AppImage for pg_top. diff --git a/docker/appimage-build b/docker/appimage-build deleted file mode 100755 index e094692..0000000 --- a/docker/appimage-build +++ /dev/null @@ -1,26 +0,0 @@ -#!/bin/sh - -which docker > /dev/null 2>&1 -if [ $? -ne 0 ]; then - echo "docker is not in your path" - exit 1 -fi - -DOCKER_DIR=`dirname $0` -DOCKER_DIR=`readlink -f $DOCKER_DIR` - -DOCKER_TAG="pg_top-appimage" - -# Use the return code from `docker inspect` to determine if the docker image -# needs to be created. -docker inspect $DOCKER_TAG > /dev/null -if [ $? -ne 0 ]; then - ${DOCKER_DIR}/appimage-prepare || exit 1 -fi - -UID=`id -u` -GID=`id -g` - -docker run --rm -v ${DOCKER_DIR}/..:/usr/local/src/pg_top:rw \ - -w /usr/local/src/pg_top -u ${UID}:${GID} $DOCKER_TAG \ - make appimage-docker diff --git a/docker/appimage-prepare b/docker/appimage-prepare deleted file mode 100755 index 8e1ae76..0000000 --- a/docker/appimage-prepare +++ /dev/null @@ -1,14 +0,0 @@ -#!/bin/sh - -which docker > /dev/null 2>&1 -if [ $? -ne 0 ]; then - echo "docker is not in your path" - exit 1 -fi - -DOCKER_DIR=`dirname $0` -DOCKER_DIR=`readlink -f $DOCKER_DIR` - -DOCKER_TAG="pg_top-appimage" - -(cd $DOCKER_DIR/.. && docker build -t $DOCKER_TAG -f Dockerfile.appimage .) |