Skip to content

Commit

Permalink
dockerfile updates
Browse files Browse the repository at this point in the history
  • Loading branch information
jdetaeye committed Feb 18, 2024
1 parent 589fb59 commit a5639af
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 10 deletions.
18 changes: 16 additions & 2 deletions contrib/docker/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ if(docker)
COMMAND ${CMAKE_COMMAND} -E env DOCKER_BUILDKIT=1
${docker} build ubuntu-20.04
--progress=plain
--squash
--tag "frepple-${PROJECT_BRANCH}-ubuntu-20.04:${PROJECT_VERSION}"
--tag "frepple-${PROJECT_BRANCH}:${PROJECT_VERSION}"
--tag "ghcr.io/frepple/frepple-${PROJECT_BRANCH}:${PROJECT_VERSION}"
Expand Down Expand Up @@ -51,8 +50,23 @@ if(docker)
down
)

configure_file("${CMAKE_CURRENT_SOURCE_DIR}/ubuntu-devel.dockerfile" ubuntu-devel/dockerfile COPYONLY)
configure_file("${CMAKE_CURRENT_SOURCE_DIR}/entrypoint.sh" ubuntu-devel/entrypoint.sh COPYONLY)
configure_file("${CMAKE_SOURCE_DIR}/requirements.txt" ubuntu-devel/requirements.txt COPYONLY)
add_custom_target(
"docker-ubuntu-devel"
COMMAND ${CMAKE_COMMAND} --build . --target package_source
COMMAND ${CMAKE_COMMAND} -E copy "${CMAKE_BINARY_DIR}/frepple-${PROJECT_VERSION}-Source.tar.gz" "${CMAKE_CURRENT_BINARY_DIR}/ubuntu-devel/"
COMMAND ${CMAKE_COMMAND} -E env DOCKER_BUILDKIT=1
${docker} build --progress=plain --target package --output type=local,dest=. ubuntu-devel
COMMAND ${CMAKE_COMMAND} -E env DOCKER_BUILDKIT=1
${docker} build ubuntu-devel
--progress=plain
--tag "frepple-${PROJECT_BRANCH}-ubuntu-devel:${PROJECT_VERSION}"
)

# Build-only images
foreach(dist opensuse-15.1 rockylinux-8 debian-10 ubuntu-devel)
foreach(dist opensuse-15.1 rockylinux-8 debian-10)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/${dist}.dockerfile ${dist}/dockerfile COPYONLY)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/entrypoint.sh ${dist}/entrypoint.sh COPYONLY)
add_custom_target(
Expand Down
16 changes: 9 additions & 7 deletions contrib/docker/ubuntu-devel.dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -60,16 +60,18 @@ FROM ubuntu:devel
ENV LANG C.UTF-8
ENV LC_ALL C.UTF-8

RUN apt-get -y -q update && \
DEBIAN_FRONTEND=noninteractive apt-get -y install --no-install-recommends curl ca-certificates gnupg && \
curl https://www.postgresql.org/media/keys/ACCC4CF8.asc | apt-key add - && \
echo "deb http://apt.postgresql.org/pub/repos/apt/ focal-pgdg main" > /etc/apt/sources.list.d/pgdg.list && \
apt-get -y -q update && \
DEBIAN_FRONTEND=noninteractive apt-get -y install postgresql-client-15 postgresql-client-16
# # Download postgres clients (use when there are major postgresql releases which aren't in this ubuntu release)
# RUN apt-get -y -q update && \
# DEBIAN_FRONTEND=noninteractive apt-get -y install --no-install-recommends curl ca-certificates gnupg && \
# curl https://www.postgresql.org/media/keys/ACCC4CF8.asc | apt-key add - && \
# echo "deb http://apt.postgresql.org/pub/repos/apt/ focal-pgdg main" > /etc/apt/sources.list.d/pgdg.list && \
# apt-get -y -q update && \
# DEBIAN_FRONTEND=noninteractive apt-get -y install postgresql-client-15 postgresql-client-16

COPY --from=builder /build/*.deb .

RUN DEBIAN_FRONTEND=noninteractive TZ=Etc/UTC apt install --no-install-recommends -f -y -q ./*.deb && \
RUN apt-get -y -q update && \
DEBIAN_FRONTEND=noninteractive TZ=Etc/UTC apt install --no-install-recommends -f -y -q ./*.deb && \
apt-get -y purge --autoremove && \
apt-get clean && \
rm -rf *.deb /var/lib/apt/lists/* /etc/apt/sources.list.d/pgdg.list
Expand Down
2 changes: 1 addition & 1 deletion contrib/linux/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ if(CMAKE_SYSTEM_NAME MATCHES "Linux")
"${CMAKE_CURRENT_SOURCE_DIR}/config"
)
set(CPACK_DEBIAN_PACKAGE_DEPENDS
"adduser, libxerces-c3.2 | libxerces-c3.1, apache2, libapache2-mod-wsgi-py3, libapache2-mod-xsendfile, postgresql-client-15 | postgresql-client-14 | postgresql-client, psmisc, locales, libpq5, openssl, ssl-cert")
"adduser, libxerces-c3.2 | libxerces-c3.1, apache2, libapache2-mod-wsgi-py3, libapache2-mod-xsendfile, postgresql-client-16 | postgresql-client-15 | postgresql-client-14 | postgresql-client, psmisc, locales, libpq5, openssl, ssl-cert")

# RPM style packaging
if(DISTRO STREQUAL "opensuse15")
Expand Down

0 comments on commit a5639af

Please sign in to comment.