packing-box / docker-packing-box

Docker image gathering packers and tools for making datasets of packed executables and training machine learning models for packing detection
GNU General Public License v3.0
49 stars 10 forks source link

Docker build failed #10

Closed kylin-zhou closed 2 years ago

kylin-zhou commented 2 years ago
Step 8/43 : RUN (apt -qq update  && apt -qq -y upgrade  && apt -qq -y autoremove  && apt -qq autoclean) 2>&1 > /dev/null  || echo -e "\033[1;31m SYSTEM UPGRADE FAILED \033[0m"
 ---> Running in 9033b2f3f539
dhondta commented 2 years ago

Hi @Aida-yy I recently upgraded my Dockerfile from Ubuntu 20.04 to 22.04 and I faced some issues I thought I had solved since then. This may be related. However, it's weird that it fails at this precise step as it only relates to simple APT operations. Could you re-run the build with verbosity and provide the trace, please ?

kylin-zhou commented 2 years ago

Thanks! My running log is as follows:

Sending build context to Docker daemon  25.98MB
Step 1/43 : FROM ubuntu:22.04 AS base
 ---> 216c552ea5ba
Step 2/43 : MAINTAINER Alexandre DHondt <alexandre.dhondt@gmail.com>
 ---> Using cache
 ---> 54b54502d33f
Step 3/43 : LABEL version="1.2.0"
 ---> Using cache
 ---> 7a7f956819ee
Step 4/43 : LABEL source="https://github.com/dhondta/packing-box"
 ---> Using cache
 ---> 0e62a27bf58a
Step 5/43 : ENV DEBIAN_FRONTEND noninteractive
 ---> Using cache
 ---> 59eb44fd3666
Step 6/43 : ENV TERM xterm-256color
 ---> Using cache
 ---> 68791ca0aefd
Step 7/43 : RUN useradd test -p test
 ---> Using cache
 ---> 070a1646be3f
Step 8/43 : RUN (apt -qq update  && apt -qq -y upgrade  && apt -qq -y autoremove  && apt -qq autoclean) 2>&1 > /dev/null  || echo -e "\033[1;31m SYSTEM UPGRADE FAILED \033[0m"
 ---> Using cache
 ---> 8293b44facb8
Step 9/43 : RUN (apt -qq -y install apt-transport-https apt-utils  && apt -qq -y install bash-completion build-essential clang cmake software-properties-common  && apt -qq -y install libavcodec-dev libavformat-dev libavutil-dev libbsd-dev libboost-regex-dev                        libgirepository1.0-dev libelf-dev libffi-dev libfontconfig1-dev libgif-dev libjpeg-dev  && apt -qq -y install libboost-program-options-dev libboost-system-dev libboost-filesystem-dev libc6-dev-i386                        libcairo2-dev libdbus-1-dev libegl1-mesa-dev libfreetype6-dev libfuse-dev libgl1-mesa-dev                        libglib2.0-dev libglu1-mesa-dev libpulse-dev libssl-dev libsvm-dev libsvm-java libtiff5-dev                        libudev-dev libxcursor-dev libxkbfile-dev libxml2-dev libxrandr-dev) 2>&1 > /dev/null  || echo -e "\033[1;31m DEPENDENCIES INSTALL FAILED \033[0m"
 ---> Running in becd68c47f85

WARNING: apt does not have a stable CLI interface. Use with caution in scripts.

debconf: delaying package configuration, since apt-utils is not installed

WARNING: apt does not have a stable CLI interface. Use with caution in scripts.
dhondta commented 2 years ago

Hi @Aida-yy I don't see any error in this. the string with INSTALL FAILED is part of the command to be executed. If it really fails, you will see the full string in red in your console. Please note that you may see some errors in some of the next steps but that does not prevent the build from finishing. I'm still working to fix them.

kylin-zhou commented 2 years ago

Yes, Thank you! I checked my run log but I got errors at other steps.

at step11:

Step 11/43 : RUN go mod init && go env -w GO111MODULE=auto
 ---> Running in 75353abb7903
go: cannot determine module path for source directory / (outside GOPATH, module path must be specified)

Example usage:
        'go mod init example.com/m' to initialize a v0 or v1 module
        'go mod init example.com/m/v2' to initialize a v2 module

Run 'go help mod init' for more information.
The command '/bin/sh -c go mod init && go env -w GO111MODULE=auto' returned a non-zero code: 1

I solved by:

FROM golang:1.17 AS build
RUN go mod init example/m && go env -w GO111MODULE=auto

at step18:

/bin/sh: 1: add-apt-repository: not found
-e  WINE INSTALL FAILED

I solved by:

apt-get install -y software-properties-common

at install dosemu:

The following packages have unmet dependencies:
 dosemu2 : Depends: libc6 (>= 2.34) but 2.31-13+deb11u5 is to be installed
           Depends: fdpp but it is not going to be installed
           Recommends: libfluidsynth3 (>= 2.0.5) but it is not installable
           Recommends: kbd but it is not going to be installed

I am trying to solve.

There may be other unknown issues, can you provide a imag file or update dockerfile? Thank you very much!

dhondta commented 2 years ago

Hi @Aida-yy ! I'm still working on refining the Dockerfile to make it work on a base image of Ubuntu 22.04 and to use a non-privileged user. It will fix your issue. Work in progress...

kylin-zhou commented 2 years ago

Thank you!

dhondta commented 2 years ago

Hi @Aida-yy ! The new Dockerfile is ready but has still a few issues (i.e. installation of Wine). The issue related to go mod init has been fixed.

kylin-zhou commented 2 years ago

Thanks! It works now. All other “apt“ related issues seem to be caused by network , which have now been resolved.