Skip to content

Commit 6c0c600

Browse files
authored
Merge pull request zerebubuth#399 from mmd-osm/patch/ubuntu2404
Add build on Ubuntu 24.04
2 parents 001dc8a + f506808 commit 6c0c600

File tree

3 files changed

+84
-1
lines changed

3 files changed

+84
-1
lines changed

.github/workflows/docker_2404.yml

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
name: Build on Ubuntu 24.04
2+
3+
on: [push, pull_request]
4+
5+
jobs:
6+
build:
7+
runs-on: ubuntu-latest
8+
9+
steps:
10+
- name: Checkout
11+
uses: actions/checkout@v4
12+
13+
- name: Build Docker images
14+
uses: docker/build-push-action@v5
15+
with:
16+
file: docker/ubuntu/Dockerfile2404
17+
load: true
18+
tags: cgimap:2404
19+
- name: Running Docker image
20+
run: |
21+
docker run --entrypoint /bin/bash cgimap:2404 -c "/usr/local/bin/openstreetmap-cgimap --help"

docker/ubuntu/Dockerfile2404

+62
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
# vim:set ft=dockerfile:
2+
FROM ubuntu:24.04 AS builder
3+
4+
ENV DEBIAN_FRONTEND=noninteractive
5+
6+
RUN apt-get update -qq && \
7+
apt-get install -y gcc g++ make cmake \
8+
libfcgi-dev libxml2-dev libmemcached-dev libbrotli-dev \
9+
libboost-program-options-dev libcrypto++-dev libyajl-dev \
10+
libpqxx-dev zlib1g-dev libfmt-dev \
11+
postgresql-16 postgresql-server-dev-all \
12+
--no-install-recommends && \
13+
apt-get clean && \
14+
rm -rf /var/lib/apt/lists/*
15+
16+
WORKDIR /app
17+
18+
# Copy the main application.
19+
COPY . ./
20+
21+
# Compile, install and remove source
22+
RUN mkdir build && cd build && \
23+
CXXFLAGS="-Wall -Wextra -Wpedantic -Wno-unused-parameter" cmake .. -DBUILD_SHARED_LIBS=OFF -DBUILD_TESTING=ON -DCMAKE_BUILD_TYPE=Release && \
24+
make -j${nproc} && \
25+
ctest --output-on-failure && \
26+
strip openstreetmap-cgimap && \
27+
cp openstreetmap-cgimap ../
28+
29+
FROM ubuntu:24.04
30+
31+
RUN apt-get update -qq && \
32+
apt-get install -y \
33+
libfcgi-bin libmemcached11 libboost-program-options1.83.0 \
34+
libxml2 libcrypto++8 libyajl2 libpqxx-7.8t64 zlib1g libbrotli1 libfmt9 \
35+
--no-install-recommends && \
36+
apt-get clean && \
37+
rm -rf /var/lib/apt/lists/*
38+
39+
COPY --from=builder /app/openstreetmap-cgimap /usr/local/bin
40+
41+
RUN groupadd -g 61000 cgimap && \
42+
useradd -g 61000 -l -M -s /bin/false -u 61000 cgimap
43+
44+
USER cgimap
45+
46+
ENV CGIMAP_HOST db
47+
ENV CGIMAP_DBNAME openstreetmap
48+
ENV CGIMAP_USERNAME openstreetmap
49+
ENV CGIMAP_PASSWORD openstreetmap
50+
ENV CGIMAP_MEMCACHE memcached
51+
ENV CGIMAP_RATELIMIT 204800
52+
ENV CGIMAP_MAXDEBT 250
53+
ENV CGIMAP_MODERATOR_RATELIMIT 1048576
54+
ENV CGIMAP_MODERATOR_MAXDEBT 1024
55+
ENV CGIMAP_PORT 8000
56+
ENV CGIMAP_INSTANCES 10
57+
58+
EXPOSE 8000
59+
60+
ENTRYPOINT /usr/local/bin/openstreetmap-cgimap --pidfile /tmp/cgimap.pid --logfile=/proc/1/fd/1 --daemon && \
61+
tail --pid=$(cat /tmp/cgimap.pid) -f /dev/null
62+

src/main.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ void get_options(int argc, char **argv, po::variables_map &options) {
146146
if (options.count("help")) {
147147
std::cout << desc << std::endl;
148148
output_backend_options(std::cout);
149-
exit(1);
149+
exit(0);
150150
}
151151

152152
po::store(po::parse_environment(desc,

0 commit comments

Comments
 (0)