Sign inSign up

openeuler/glibc

Sponsored OSS

By openeuler

Updated about 2 months ago

Image
0

5.2K

openeuler/glibc repository overview

Quick reference

Glibc | openEuler

Current Glibc docker images are built on the openEuler. This repository is free to use and exempted from per-user rate limits.

The GNU C Library project provides the core libraries for the GNU system and GNU/Linux systems, as well as many other systems that use Linux as the kernel. These libraries provide critical APIs including ISO C11, POSIX.1-2008, BSD, OS-specific APIs and more. These APIs include such foundational facilities as open, read, write, malloc, printf, getaddrinfo, dlopen, pthread_create, crypt, login, exit and more.

Learn more about Glibc on Glibc Website⁠.

The tag of each glibc docker image is consist of the version of glibc and the version of basic image. The details are as follows

TagCurrentlyArchitectures
2.42-oe2403sp4glibc 2.42 on openEuler 24.03-LTS-SP4amd64, arm64
2.42-oe2403sp2glibc 2.42 on openEuler 24.03-LTS-SP2amd64, arm64
2.41-oe2403sp1glibc 2.41 on openEuler 24.03-LTS-SP1amd64, arm64

Usage

In this usage, users can select the corresponding {Tag} based on their requirements.

  • Pull the openeuler/glibc image from docker

    docker pull openeuler/glibc:{Tag}
    
  • To run and enter the glibc container with an interactive shell:

    docker run -it --rm openeuler/glibc:{Tag} bash
    
  • Write a test program Here is an example:

    #include <stdio.h>
    #include <gnu/libc-version.h>
    
    int main() {
        printf("Hello, Glibc 2.41!\n");
        printf("Current Glibc version: %s\n", gnu_get_libc_version());
        return 0;
    }
    

    You'll need to hava GCC installed first to compile this program.

    dnf install -y gcc
    
  • Compile the program against the new glibc version

    Create a simple C program (e.g., test.c) to verify Glibc functionality. The glibc is installed at /usr/local/glibc, specify the compiler options with the glibc directory.

     gcc test.c -o test_program \
     -I/usr/local/glibc/include \
     -Wl,--rpath=/usr/local/glibc/lib \
     -Wl,--dynamic-linker=/usr/local/glibc/lib/ld-linux-aarch64.so.1
    

    This compilation command targets the aarch64 platform, you need to modify the dynamic linker path to match the target platform.

    After successful compilation, execute the binary to verify the output message:

    ./test_program
    
  • Key Parameter Description:

    ParameterFunction
    -I/usr/local/glibc/includeSpecifies the header file path of the new Glibc version.
    -Wl,--rpath=/usr/local/glibc/libPriorities loading libraries from this path during runtime.
    -Wl,--dynamic-linker=/usr/local/glibc/lib/ld-linux-aarch64.so.1Specifies the new version dynamic linker.

Question and answering

If you have any questions or want to use some special features, please submit an issue or a pull request on openeuler-docker-images.

Tag summary

Content type

Image

Digest

sha256:44d70e076

Size

101.3 MB

Last updated

about 2 months ago

docker pull openeuler/glibc

This week's pulls

Pulls:

16

Last week