carlonluca / docker-qt

Collection of data to create docker images with Qt support.
GNU General Public License v3.0
34 stars 9 forks source link

Can't use DockerFile in my project #6

Open DanuulKa03 opened 1 month ago

DanuulKa03 commented 1 month ago

Good day!

I was trying to set up Qt 6.8.0. Your Dockerfile was supposed to help with setting up my project, but I couldn't get it to run. I tried to run the Dockerfile itself, but I encountered the following error:

Dockerfile:12
--------------------
  10 |     COPY qt_export/Qt-android-$QTVER.tar.xz /root/
  11 |     
  12 | >>> COPY builder/toolchain.cmake /root/
  13 |     
  14 |     RUN \
--------------------
ERROR: failed to solve: failed to compute cache key: failed to calculate checksum of ref bl7qjx5tv6rb369fxmtvig1qe::3f0u0y6qsyhd047ln0ho1mhep: "/builder/toolchain.cmake": not found
Failed to deploy '<unknown> Dockerfile: Dockerfile': Image build failed with exit code 1.

Here is the structure of my project:

.
├── CMakeLists.txt
├── Dockerfile
├── main.cpp
├── main.qml
├── qml.qrc
├── scripts
│   └── build_6.8.0_android.sh
└── src
    └── qml
        ├── Common
        │   ├── Colors.qml
        │   ├── Consts.qml
        │   ├── Enums.qml
        │   └── qmldir
        ├── Pages
        │   ├── Login
        │   │   ├── AuthenticationPage.qml
        │   │   └── AuthenticationPage_Form.ui.qml
        │   ├── Menu
        │   │   ├── MainMenuPage.qml
        │   │   └── MainMenuPage_Form.ui.qml
        │   ├── PageFactory.qml
        │   ├── Splash
        │   │   ├── SplashPage.qml
        │   │   └── SplashPage_Form.ui.qml
        │   └── qmldir
        └── UILibrary
            ├── Components
            │   ├── TopPanel.qml
            │   ├── TopPanel_Form.ui.qml
            │   └── qmldir
            └── Forms
                ├── BaseForm.qml
                ├── OneButtonForm.qml
                ├── TwoButtonsForm.qml
                └── qmldir

12 directories, 25 files

Can you please advise me on what I might be doing wrong?

carlonluca commented 1 month ago

What are you trying to accomplish?

DanuulKa03 commented 1 month ago

I am trying to achieve building my project for the Android platform. After that, I want to run this application inside a Docker container, displaying the output through X11.

carlonluca commented 1 month ago

To build the app for Android you can simply use the image in docker hub. I've never run an apk in a container, so can't help with that, sorry.

DanuulKa03 commented 3 weeks ago

Hello! I have analyzed and concluded that, to start, I only need the qt-dev Docker image for application development purposes. Then, I would use qt-builder for building on other platforms, such as different Android versions, etc. Did I understand this correctly?

The next thing I would really like your help with is understanding the following. I created my own Dockerfile:

# Base image
FROM carlonluca/qt-dev:6.8.0

# Copy the current directory to /firmware in the container
COPY . /firmware
WORKDIR /firmware

# Install necessary packages and configure Git
RUN git config --global --add safe.directory /firmware && \
    apt update && \
    apt -y install openssh-server rsync

# Configure SSH server
RUN mkdir /var/run/sshd && \
    echo 'root:root' | chpasswd && \
    sed -i 's/PermitRootLogin prohibit-password/PermitRootLogin yes/' /etc/ssh/sshd_config && \
    sed 's@session\s*required\s*pam_loginuid.so@session optional pam_loginuid.so@g' -i /etc/pam.d/sshd && \
    echo "export VISIBLE=now" >> /etc/profile && \
    useradd -ms /bin/bash tvgu && \
    echo 'tvgu:tvgu' | chpasswd

# Set environment variable for user visibility
ENV NOTVISIBLE "in users profile"

# Command to run the SSH server
CMD ["/usr/sbin/sshd", "-D"]

# Expose ports 22 (for SSH) and 7777
EXPOSE 22 7777

Everything works perfectly, but I don’t understand how to start building the project for my computer.