Sign inSign up

circutor/rtu_arm_build

By circutor

•Updated almost 2 years ago

a docker image for the correct build of the arm64 binary file for the RTU.

Image
0

339

circutor/rtu_arm_build repository overview

Docker image that isolates a arm64 architecture build process. It takes the previously compiled libxml2 (v2.3.13) with the aarch64-linux-gnu-gcc compiler and configure the pkg_config to use it as a dependency for the correct build of the project.

# Use an official base image with necessary tools
FROM ubuntu:22.04

# Set environment variables to avoid interactive prompts
ENV DEBIAN_FRONTEND=noninteractive

# Install required packages and dependencies
RUN apt-get update && apt-get install -y \
    build-essential \
    autoconf \
    automake \
    libtool \
    pkg-config \    
    gcc-aarch64-linux-gnu \
    g++-aarch64-linux-gnu \
    zlib1g \
    wget && \    
    apt-get clean



# Install Go 1.21.3
RUN wget https://go.dev/dl/go1.21.3.linux-amd64.tar.gz && \
    tar -C /usr/local -xzf go1.21.3.linux-amd64.tar.gz && \
    rm go1.21.3.linux-amd64.tar.gz

# Install libxml2
RUN wget https://download.gnome.org/sources/libxml2/2.13/libxml2-2.13.3.tar.xz && \
    tar -xf libxml2-2.13.3.tar.xz && \
    cd libxml2-2.13.3 && \    
    ./configure --build=x86_64-linux-gnu  --host=aarch64-linux-gnu  --prefix=/app/xmlTest --disable-shared --without-icu --enable-static --without-python && \
    make && \
    make install && \
    cd .. && \
    rm -rf libxml2-2.13.3 libxml2-2.13.3.tar.gz

# Set Go environment variables
ENV PATH="/usr/local/go/bin:${PATH}"
ENV GOARCH=arm64
ENV GOOS=linux
ENV CC=aarch64-linux-gnu-gcc
ENV CGO_ENABLED=1



# Set PKG_CONFIG_PATH, LD_LIBRARY_PATH, CGO_CFLAGS, and CGO_LDFLAGS to include the precompiled libxml2
ENV PKG_CONFIG_PATH=/app/xmlTest/lib/pkgconfig
ENV LD_LIBRARY_PATH=/app/xmlTest/lib
ENV CGO_CFLAGS="-I/app/xmlTest/include/libxml2"
ENV CGO_LDFLAGS="-L/app/xmlTest/lib -lxml2"

to test this docker image:

docker run --rm circutor/rtu_arm_build:latest 

Tag summary

Content type

Image

Digest

sha256:474d5717c…

Size

336.2 MB

Last updated

almost 2 years ago

docker pull circutor/rtu_arm_build