Flutter dev workspace

Hello,

I’m trying to make a docker for make dev on flutter env.

My Dockerfile is :

# Use an official Ubuntu runtime as a parent image
FROM ubuntu:22.04

# Set environment variables
ENV ANDROID_HOME=/opt/android-sdk
ENV ANDROID_NDK_HOME=/opt/android-ndk-bundle
ENV ANDROID_SDK_TOOLS_DIR=$ANDROID_HOME/tools
ENV ANDROID_PLATFORM_TOOLS_DIR=$ANDROID_HOME/platform-tools
ENV PATH=$PATH:$ANDROID_HOME:$ANDROID_NDK_HOME:$ANDROID_SDK_TOOLS_DIR:$ANDROID_PLATFORM_TOOLS_DIR

# Update the package repository
RUN apt-get update

# Install required packages
RUN apt-get install -y wget tar unzip xz-utils curl openjdk-8-jdk git

# Download and install Android SDK
RUN mkdir -p /opt \
    && curl -s "https://dl.google.com/android/repository/commandlinetools-linux-7302050_latest.zip" \
    -o /tmp/commandlinetools-linux-7302050_latest.zip \
    && unzip -d /opt /tmp/commandlinetools-linux-7302050_latest.zip \
    && rm /tmp/commandlinetools-linux-7302050_latest.zip \
    && echo y | /opt/tools/bin/sdkmanager --licenses \
    && /opt/tools/bin/sdkmanager "platforms;android-29" \
    && /opt/tools/bin/sdkmanager "platform-tools" \
    && /opt/tools/bin/sdkmanager "build-tools;29.0.3"

# Download and install Android NDK
RUN curl -s "https://dl.google.com/android/repository/android-ndk-r21b-linux-x86_64.zip" \
    -o /tmp/android-ndk-r21b-linux-x86_64.zip \
    && unzip -d /opt /tmp/android-ndk-r21b-linux-x86_64.zip \
    && rm /tmp/android-ndk-r21b-linux-x86_64.zip

# Download and install Flutter
RUN mkdir -p /usr/local \
    && curl -s "https://storage.googleapis.com/flutter_infra_release/releases/stable/linux/flutter_linux_3.7.9-stable.tar.xz" \
    -o /tmp/flutter_linux_3.7.9-stable.tar.xz \
    && tar -xJf /tmp/flutter_linux_3.7.9-stable.tar.xz -C /usr/local \
    && rm /tmp/flutter_linux_3.7.9-stable.tar.xz

# Set up the Flutter environment
RUN export PATH=$PATH:/usr/local/flutter/bin \
    && flutter channel stable \
    && flutter precache \
    && flutter doctor

And i do the following command :

docker build -t my_dev_flutter:v1.0.0 .

I have some errors :

/sbin/ldconfig.real: Path `/usr/lib/x86_64-linux-gnu' given more than once
(from <builtin>:0 and /etc/ld.so.conf.d/x86_64-linux-gnu.conf:3)
/sbin/ldconfig.real: Path `/usr/lib' given more than once
(from <builtin>:0 and <builtin>:0)
/usr/lib/x86_64-linux-gnu/libfakeroot: (from /etc/ld.so.conf.d/fakeroot-x86_64-linux-gnu.conf:1)
	libfakeroot-0.so -> libfakeroot-0.so
/usr/local/lib: (from /etc/ld.so.conf.d/libc.conf:2)
/lib/x86_64-linux-gnu: (from /etc/ld.so.conf.d/x86_64-linux-gnu.conf:3)
Aborted (core dumped)
dpkg: error processing package libc-bin (--configure):
 installed libc-bin package post-installation script subprocess returned error exit status 134
Processing triggers for ca-certificates (20230311ubuntu0.22.04.1) ...
Updating certificates in /etc/ssl/certs...
0 added, 0 removed; done.
Running hooks in /etc/ca-certificates/update.d...
done.
Errors were encountered while processing:
 libc-bin
E: Sub-process /usr/bin/dpkg returned an error code (1)
The command '/bin/sh -c apt-get update  && apt-get -y  install dialog apt-utils ca-certificates  build-essential' returned a non-zero code: 100

Do you have already see that ?

It doesn’t seem to be related to Docker, but I searched for the first line (in the code block) of the error message and found this

The accepted answer says you need to delete /etc/ld.so.conf.d/x86_64-linux-gnu.conf

Does it help?

Hi,

thanks for your answer.

I remove the file /etc/ld.so.conf.d/x86_64-linux-gnu.conf

But I have again an error :

update-alternatives: warning: skip creation of /usr/share/man/man1/c++.1.gz because associated file /usr/share/man/man1/g++.1.gz (of link group c++) doesn't exist
Setting up gnupg (2.2.27-3ubuntu2.1) ...
Setting up build-essential (12.9ubuntu3) ...
Setting up libalgorithm-diff-xs-perl (0.04-6build3) ...
Setting up libalgorithm-merge-perl (0.08-3) ...
Processing triggers for libc-bin (2.35-0ubuntu3.6) ...
Aborted (core dumped)
/sbin/ldconfig.real: Can't stat /usr/local/lib/x86_64-linux-gnu: No such file or directory
/sbin/ldconfig.real: Path `/usr/lib/x86_64-linux-gnu' given more than once
(from /etc/ld.so.conf.d/x86_64-linux-gnu.conf:4 and /etc/ld.so.conf.d/x86_64-linux-gnu.conf:3)
/sbin/ldconfig.real: Path `/lib/x86_64-linux-gnu' given more than once
(from <builtin>:0 and /etc/ld.so.conf.d/x86_64-linux-gnu.conf:3)
/sbin/ldconfig.real: Path `/usr/lib/x86_64-linux-gnu' given more than once
(from <builtin>:0 and /etc/ld.so.conf.d/x86_64-linux-gnu.conf:3)
/sbin/ldconfig.real: Path `/usr/lib' given more than once
(from <builtin>:0 and <builtin>:0)
/usr/lib/x86_64-linux-gnu/libfakeroot: (from /etc/ld.so.conf.d/fakeroot-x86_64-linux-gnu.conf:1)
	libfakeroot-0.so -> libfakeroot-0.so
/usr/local/lib: (from /etc/ld.so.conf.d/libc.conf:2)
/lib/x86_64-linux-gnu: (from /etc/ld.so.conf.d/x86_64-linux-gnu.conf:3)
Aborted (core dumped)
dpkg: error processing package libc-bin (--configure):
 installed libc-bin package post-installation script subprocess returned error exit status 134
Processing triggers for ca-certificates (20230311ubuntu0.22.04.1) ...
Updating certificates in /etc/ssl/certs...
0 added, 0 removed; done.
Running hooks in /etc/ca-certificates/update.d...
done.
Errors were encountered while processing:
 libc-bin
E: Sub-process /usr/bin/dpkg returned an error code (1)
The command '/bin/sh -c apt-get update  && apt-get -y  install dialog apt-utils ca-certificates  build-essential' returned a non-zero code: 100