[修改]exporter的docker优化
This commit is contained in:
@@ -1,26 +1,41 @@
|
||||
FROM openeuler/openeuler:24.03 AS dev
|
||||
|
||||
RUN dnf update -y && \
|
||||
dnf install -y git gcc g++ gdb make autoconf automake curl zip unzip tar &&\
|
||||
dnf install -y git gcc g++ gdb make ninja-build autoconf automake curl zip unzip tar &&\
|
||||
dnf clean all && \
|
||||
rm -rf /var/cache/dnf/*
|
||||
|
||||
ENV VCPKG_ROOT="/vcpkg"
|
||||
ENV VCPKG_ROOT="/vcpkg" \
|
||||
VCPKG_FORCE_SYSTEM_BINARIES=1
|
||||
|
||||
RUN curl -fsSL https://github.com/Kitware/CMake/releases/download/v3.27.2/cmake-3.27.2-linux-x86_64.sh -o cmake_install.sh && \
|
||||
chmod +x cmake_install.sh && \
|
||||
./cmake_install.sh --prefix=/usr/local --skip-license && \
|
||||
rm -rf cmake_install.sh
|
||||
RUN architecture=$(uname -m) && \
|
||||
if [ "$architecture" = "aarch64" ]; then \
|
||||
echo "Current architecture is ARM64"; \
|
||||
curl -fsSL https://github.com/Kitware/CMake/releases/download/v3.27.2/cmake-3.27.2-linux-aarch64.sh -o cmake_install.sh && \
|
||||
chmod +x cmake_install.sh && \
|
||||
./cmake_install.sh --prefix=/usr/local --skip-license && \
|
||||
rm -rf cmake_install.sh; \
|
||||
elif [ "$architecture" = "x86_64" ]; then \
|
||||
echo "Current architecture is x86_64"; \
|
||||
curl -fsSL https://github.com/Kitware/CMake/releases/download/v3.27.2/cmake-3.27.2-linux-x86_64.sh -o cmake_install.sh && \
|
||||
chmod +x cmake_install.sh && \
|
||||
./cmake_install.sh --prefix=/usr/local --skip-license && \
|
||||
rm -rf cmake_install.sh; \
|
||||
else \
|
||||
echo "platform [$architecture] not supported"; \
|
||||
exit 1; \
|
||||
fi
|
||||
|
||||
RUN curl -fsSL https://github.com/ninja-build/ninja/releases/download/v1.11.1/ninja-linux.zip -o ninja-linux.zip && \
|
||||
unzip ninja-linux.zip && \
|
||||
rm -rf ninja-linux.zip && \
|
||||
mv ninja /usr/local/bin/ && \
|
||||
chmod +x /usr/local/bin/ninja
|
||||
|
||||
RUN curl -fsSL https://github.com/microsoft/vcpkg-tool/releases/download/2024-07-10/vcpkg-glibc -o /usr/local/bin/vcpkg && \
|
||||
chmod +x /usr/local/bin/vcpkg && \
|
||||
git clone -b 2024.07.12 --depth 1 https://github.com/microsoft/vcpkg /vcpkg
|
||||
RUN git clone -b 2024-08-01 --depth 1 https://github.com/microsoft/vcpkg-tool.git /tmp/vcpkg-tool \
|
||||
&& cd /tmp/vcpkg-tool \
|
||||
&& mkdir build \
|
||||
&& cd build \
|
||||
&& cmake .. \
|
||||
&& cmake --build . --target vcpkg \
|
||||
&& cp ./vcpkg /usr/local/bin/ \
|
||||
&& chmod +x /usr/local/bin/vcpkg \
|
||||
&& git clone -b 2024.08.23 --depth 1 https://github.com/microsoft/vcpkg.git /vcpkg \
|
||||
&& rm -rf /tmp/vcpkg-tool
|
||||
|
||||
RUN vcpkg install civetweb prometheus-cpp spdlog nlohmann-json yaml-cpp open62541 --clean-after-build
|
||||
|
||||
@@ -44,8 +59,19 @@ RUN dnf update -y && \
|
||||
dnf clean all && \
|
||||
rm -rf /var/cache/dnf/*
|
||||
|
||||
RUN curl -fsSL https://github.com/abtreece/confd/releases/download/v0.20.0/confd-v0.20.0-linux-amd64.tar.gz | tar -xz -C /usr/local/bin && \
|
||||
chmod +x /usr/local/bin/confd
|
||||
RUN architecture=$(uname -m); \
|
||||
if [ "$architecture" = "aarch64" ]; then \
|
||||
echo "Current architecture is ARM64"; \
|
||||
curl -fsSL https://github.com/abtreece/confd/releases/download/v0.20.0/confd-v0.20.0-linux-arm64.tar.gz | tar -xz -C /usr/local/bin; \
|
||||
chmod +x /usr/local/bin/confd; \
|
||||
elif [ "$architecture" = "x86_64" ]; then \
|
||||
echo "Current architecture is x86_64"; \
|
||||
curl -fsSL https://github.com/abtreece/confd/releases/download/v0.20.0/confd-v0.20.0-linux-amd64.tar.gz | tar -xz -C /usr/local/bin; \
|
||||
chmod +x /usr/local/bin/confd; \
|
||||
else \
|
||||
echo "platform [$architecture] not supported"; \
|
||||
exit 1; \
|
||||
fi
|
||||
|
||||
RUN mkdir /etc/opcua
|
||||
|
||||
|
||||
Reference in New Issue
Block a user