mirror of
https://github.com/Telecominfraproject/wlan-cloud-ucentralgw.git
synced 2026-01-27 02:23:02 +00:00
* Add entrypoint script with chown and the possibility to run as a non-priviliged user * Fix docker-entrypoint.sh permissions * Set permissions on docker-entrypoint.sh since Git preserves executable bit * Change to colon separator
61 lines
1.6 KiB
Docker
61 lines
1.6 KiB
Docker
FROM alpine AS builder
|
|
|
|
RUN apk add --update --no-cache \
|
|
openssl openssh \
|
|
ncurses-libs \
|
|
bash util-linux coreutils curl \
|
|
make cmake gcc g++ libstdc++ libgcc git zlib-dev yaml-cpp-dev \
|
|
openssl-dev boost-dev unixodbc-dev postgresql-dev mariadb-dev \
|
|
apache2-utils yaml-dev apr-util-dev \
|
|
lua-dev librdkafka-dev
|
|
|
|
RUN git clone https://github.com/stephb9959/poco /poco
|
|
RUN git clone https://github.com/stephb9959/cppkafka /cppkafka
|
|
|
|
WORKDIR /cppkafka
|
|
RUN mkdir cmake-build
|
|
WORKDIR cmake-build
|
|
RUN cmake ..
|
|
RUN cmake --build . --config Release -j8
|
|
RUN cmake --build . --target install
|
|
|
|
WORKDIR /poco
|
|
RUN mkdir cmake-build
|
|
WORKDIR cmake-build
|
|
RUN cmake ..
|
|
RUN cmake --build . --config Release -j8
|
|
RUN cmake --build . --target install
|
|
|
|
ADD CMakeLists.txt build /ucentralgw/
|
|
ADD cmake /ucentralgw/cmake
|
|
ADD src /ucentralgw/src
|
|
|
|
WORKDIR /ucentralgw
|
|
RUN mkdir cmake-build
|
|
WORKDIR /ucentralgw/cmake-build
|
|
RUN cmake ..
|
|
RUN cmake --build . --config Release -j8
|
|
|
|
FROM alpine
|
|
|
|
ENV UCENTRALGW_USER=ucentralgw \
|
|
UCENTRALGW_ROOT=/ucentralgw-data \
|
|
UCENTRALGW_CONFIG=/ucentralgw-data
|
|
|
|
RUN addgroup -S "$UCENTRALGW_USER" && \
|
|
adduser -S -G "$UCENTRALGW_USER" "$UCENTRALGW_USER"
|
|
|
|
RUN mkdir /ucentral
|
|
RUN mkdir -p "$UCENTRALGW_ROOT" "$UCENTRALGW_CONFIG"
|
|
RUN apk add --update --no-cache librdkafka mariadb-connector-c libpq unixodbc su-exec
|
|
|
|
COPY --from=builder /ucentralgw/cmake-build/ucentralgw /ucentral/ucentralgw
|
|
COPY --from=builder /cppkafka/cmake-build/src/lib/* /lib/
|
|
COPY --from=builder /poco/cmake-build/lib/* /lib/
|
|
COPY docker-entrypoint.sh /
|
|
|
|
EXPOSE 15002 16002 16003 17002 16102
|
|
|
|
ENTRYPOINT ["/docker-entrypoint.sh"]
|
|
CMD ["/ucentral/ucentralgw"]
|