Closed wnark closed 2 years ago
Please refer to the steps used in build.sh. You should first source the environment. I've written some guidelines here that maybe you should read.
The results of my test below are for your reference:
$ . deepin/environment
$ docker run --rm -i hadolint/hadolint < deepin/desktop/Dockerfile
-:2 DL3006 warning: Always tag the version of an image explicitly
-:13 DL3027 warning: Do not use apt as it is meant to be a end-user tool, use apt-get or apt-cache instead
-:13 SC2028 info: echo may not expand escape sequences. Use printf.
-:42 DL3009 info: Delete the apt-get lists after installing something
$ docker run --rm -i hadolint/hadolint < deepin/wine/Dockerfile
-:3 DL3006 warning: Always tag the version of an image explicitly
-:37 DL3009 info: Delete the apt-get lists after installing something
-:37 SC2028 info: echo may not expand escape sequences. Use printf.
-:59 DL3009 info: Delete the apt-get lists after installing something
-:59 SC2028 info: echo may not expand escape sequences. Use printf.
$ dockerfilelint < deepin/desktop/Dockerfile
File: <stdin>
Issues: 4
Line 2: FROM debian AS builder
Issue Category Title Description
1 Clarity Base Image Missing Base images should specify a tag to use.
Tag
Line 42: RUN apt-get update && \
Issue Category Title Description
2 Possible Bug Use Of sudo Is Not Use of `sudo` is not allowed in a Dockerfile. From the official
Allowed document [Best practices for writing
Dockerfiles](https://docs.docker.com/engine/userguide/eng-image/doc
kerfile_best-practices/):
> You should avoid installing or using `sudo` since it has
unpredictable TTY and signal-forwarding behavior that can cause
more problems than it solves.
> If you absolutely need functionality similar to `sudo` (e.g.,
initializing the daemon as root but running it as non-root), you
may be able to use `gosu`.
3 Optimization apt-get update with Use of apt-get update should be paired with rm -rf
matching cache rm /var/lib/apt/lists/* in the same layer.
4 Optimization apt-get update All instances of `apt-get update` should have the `apt-get install`
without matching commands on the same line to reduce image size.
apt-get install
$ dockerfilelint < deepin/wine/Dockerfile
File: <stdin>
Issues: 5
Line 3: FROM $DEEPIN_BASE_IMAGE
Issue Category Title Description
1 Clarity Base Image Missing Base images should specify a tag to use.
Tag
Line 37: RUN apt-key adv --keyserver hkp://keyserver.ubuntu.com --recv-keys 1C30362C0A53D5BB && \
Issue Category Title Description
2 Optimization apt-get update with Use of apt-get update should be paired with rm -rf
matching cache rm /var/lib/apt/lists/* in the same layer.
3 Optimization apt-get update All instances of `apt-get update` should have the `apt-get install`
without matching commands on the same line to reduce image size.
apt-get install
Line 59: RUN apt-get update && \
Issue Category Title Description
4 Optimization apt-get update with Use of apt-get update should be paired with rm -rf
matching cache rm /var/lib/apt/lists/* in the same layer.
5 Optimization apt-get update All instances of `apt-get update` should have the `apt-get install`
without matching commands on the same line to reduce image size.
apt-get install
Please refer to the steps used in build.sh. You should first source the environment. I've written some guidelines here that maybe you should read.
The results of my test below are for your reference:
$ . deepin/environment $ docker run --rm -i hadolint/hadolint < deepin/desktop/Dockerfile -:2 DL3006 warning: Always tag the version of an image explicitly -:13 DL3027 warning: Do not use apt as it is meant to be a end-user tool, use apt-get or apt-cache instead -:13 SC2028 info: echo may not expand escape sequences. Use printf. -:42 DL3009 info: Delete the apt-get lists after installing something $ docker run --rm -i hadolint/hadolint < deepin/wine/Dockerfile -:3 DL3006 warning: Always tag the version of an image explicitly -:37 DL3009 info: Delete the apt-get lists after installing something -:37 SC2028 info: echo may not expand escape sequences. Use printf. -:59 DL3009 info: Delete the apt-get lists after installing something -:59 SC2028 info: echo may not expand escape sequences. Use printf. $ dockerfilelint < deepin/desktop/Dockerfile File: <stdin> Issues: 4 Line 2: FROM debian AS builder Issue Category Title Description 1 Clarity Base Image Missing Base images should specify a tag to use. Tag Line 42: RUN apt-get update && \ Issue Category Title Description 2 Possible Bug Use Of sudo Is Not Use of `sudo` is not allowed in a Dockerfile. From the official Allowed document [Best practices for writing Dockerfiles](https://docs.docker.com/engine/userguide/eng-image/doc kerfile_best-practices/): > You should avoid installing or using `sudo` since it has unpredictable TTY and signal-forwarding behavior that can cause more problems than it solves. > If you absolutely need functionality similar to `sudo` (e.g., initializing the daemon as root but running it as non-root), you may be able to use `gosu`. 3 Optimization apt-get update with Use of apt-get update should be paired with rm -rf matching cache rm /var/lib/apt/lists/* in the same layer. 4 Optimization apt-get update All instances of `apt-get update` should have the `apt-get install` without matching commands on the same line to reduce image size. apt-get install $ dockerfilelint < deepin/wine/Dockerfile File: <stdin> Issues: 5 Line 3: FROM $DEEPIN_BASE_IMAGE Issue Category Title Description 1 Clarity Base Image Missing Base images should specify a tag to use. Tag Line 37: RUN apt-key adv --keyserver hkp://keyserver.ubuntu.com --recv-keys 1C30362C0A53D5BB && \ Issue Category Title Description 2 Optimization apt-get update with Use of apt-get update should be paired with rm -rf matching cache rm /var/lib/apt/lists/* in the same layer. 3 Optimization apt-get update All instances of `apt-get update` should have the `apt-get install` without matching commands on the same line to reduce image size. apt-get install Line 59: RUN apt-get update && \ Issue Category Title Description 4 Optimization apt-get update with Use of apt-get update should be paired with rm -rf matching cache rm /var/lib/apt/lists/* in the same layer. 5 Optimization apt-get update All instances of `apt-get update` should have the `apt-get install` without matching commands on the same line to reduce image size. apt-get install
Thanks for your reply, I am using the script here cd deepin && bash build.sh The build still fails. I am using Tencent Cloud's US cloud host, so there should be no problems due to poor network.
E: Sub-process /usr/bin/dpkg returned an error code (1)
The command '/bin/sh -c apt-get update && env DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends --no-install-suggests sudo apt-transport-https ca-certificates dbus-x11 deepin-keyring gnupg libcups2 libpulse0 libxv1 locales-all mesa-utils mesa-utils-extra procps psmisc xdg-utils x11-xkb-utils x11-xserver-utils iproute2 iptables iputils-ping iputils-tracepath openssh-server openssh-client dnsutils net-tools netcat traceroute ncat socat connect-proxy haproxy tcpdump pv iftop iperf3 firefox-esr build-essential gcc make cmake git curl gawk apt-file apt-transport-https apt-utils gdebi synaptic bash-completion libpulse0 pulseaudio uuid equivs unrar lsb-release xfonts-wqy fonts-wqy-microhei fonts-wqy-zenhei nano gedit gedit-plugins vim xclip xsel deepin-app-store deepin-appstore deepin-home-appstore-daemon deepin-desktop-server deepin-default-settings dde-desktop dde-dock dde-launcher dde-control-center startdde deepin-artwork dde-file-manager dde-qt5integration deepin-wallpapers fonts-noto dde-introduction dde-kwin deepin-screensaver dde-calendar deepin-terminal && apt-get clean' returned a non-zero code: 100
Sending build context to Docker daemon 27.65kB
Step 1/13 : ARG DEEPIN_BASE_IMAGE
Step 2/13 : FROM $DEEPIN_BASE_IMAGE
pull access denied for hongyizhao/deepin-desktop, repository does not exist or may require 'docker login': denied: requested access to the resource is denied
I am using centos7 to execute it. Does the docker build still need to be exactly the same as the system you are using?
The hongyizhao/deepin-desktop
image must be built first, on which the hongyizhao/deepin-wine
is built:
$ docker images | grep hongyizhao
hongyizhao/deepin-desktop apricot ea0103aee7b6 3 months ago 3.68GB
hongyizhao/deepin-wine apricot 9f1125b8ef90 3 months ago 5.43GB
Does the docker build still need to be exactly the same as the system you are using?
Absolutely not. See here for some explanations.
Your build log shows that some additional packages that are not included in the Dockerfile are required:
This is a tricky thing. I tried to tweak the Dockerfile, but still failed to solve the problem. So, the only solution I can think of is to analyze the software packages that Deepin Desktop depends on from the Deepin ISO or installed Deepin virtual machine.
Thank you for your analysis, I will try to use dockerfile to make a minimal Ubuntu desktop, and then install the packages I need step by step.
I will try to use dockerfile to make a minimal Ubuntu desktop,
As I've commented, due to the guest OS Deepin is a Linux OS, the host OS can be any Linux distribution in principle.
and then install the packages I need step by step.
I've fixed the problem discussed here. You can see if it works on your machine as well. Please refer to the following information about the docker images and the screenshots when running them through x11docker:
$ docker images | grep hongyi
hongyizhao/deepin-wine apricot 050ee3894351 59 minutes ago 5.91GB
hongyizhao/deepin-desktop apricot 525ff1374829 About an hour ago 4.35GB
Hello, there are still some problems in the build phase.
git clone https://github.com/hongyi-zhao/dockerfile.git
cd dockerfile/
cd deepin
chmod 777 -R *
./build.sh
Then report an error: E: Package 'shutter' has no installation candidate
Thank you for reporting this problem. The shutter tool does not exist in the APT repository, but exists in Personal Package Archives (PPAs) and its GitHub repository.
I fixed the problem. You can try again.
emmm There is still a problem here
sr0: Failed to write 'change' to '/sys/devices/pci0000:00/0000:00:01.1/ata1/host0/target0:0:1/0:0:1:0/block/sr0/uevent': Read-only file system
dpkg: error processing package udisks2 (--configure):
installed udisks2 package post-installation script subprocess returned error exit status 1
Processing triggers for man-db (2.8.5-2) ...
Processing triggers for dbus (1.12.20-0+deb10u1+rebuild) ...
Processing triggers for libc-bin (2.28.19-1+dde) ...
Errors were encountered while processing:
udisks2
E: Sub-process /usr/bin/dpkg returned an error code (1)
Setting up udisks2 (2.8.1.1-1+deepin) ...
WARNING: apt does not have a stable CLI interface. Use with caution in scripts.
Reading package lists...
Building dependency tree...
Reading state information...
0 upgraded, 0 newly installed, 0 to remove and 2 not upgraded.
Removing intermediate container 743898a9fa7f
---> 9c401e1cc3b3
Step 10/11 : RUN apt-get -y update && deepin-app-store deepin-appstore deepin-home-appstore-daemon env DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends --no-install-suggests deepin-desktop-server deepin-default-settings dde-desktop dde-dock dde-launcher dde-control-center startdde deepin-artwork dde-file-manager dde-qt5integration deepin-wallpapers fonts-noto dde-introduction dde-kwin deepin-screensaver dde-calendar deepin-terminal && apt-get clean
---> Running in 9379789297e2
Hit:1 https://mirrors.tuna.tsinghua.edu.cn/deepin apricot InRelease
Reading package lists...
/bin/sh: 1: deepin-app-store: not found
The command '/bin/sh -c apt-get -y update && deepin-app-store deepin-appstore deepin-home-appstore-daemon env DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends --no-install-suggests deepin-desktop-server deepin-default-settings dde-desktop dde-dock dde-launcher dde-control-center startdde deepin-artwork dde-file-manager dde-qt5integration deepin-wallpapers fonts-noto dde-introduction dde-kwin deepin-screensaver dde-calendar deepin-terminal && apt-get clean' returned a non-zero code: 127
Sending build context to Docker daemon 1MB
Step 1/13 : ARG DEEPIN_BASE_IMAGE
Step 2/13 : FROM $DEEPIN_BASE_IMAGE
pull access denied for hongyizhao/deepin-desktop, repository does not exist or may require 'docker login': denied: requested access to the resource is denied
Fixed, please try again.
There are still some minor issues, but it looks like it has been successfully built at this stage
backend_syslog.go:45: <info> syslog is not available: Unix syslog delivery error
backend_syslog.go:45: <info> syslog is not available: Unix syslog delivery error
backend_syslog.go:45: <info> syslog is not available: Unix syslog delivery error
backend_syslog.go:45: <info> syslog is not available: Unix syslog delivery error
<info> upgradable.go:218: stat /etc/apt/sources.list.d/security.list: no such file or directory
backend_syslog.go:45: <info> syslog is not available: Unix syslog delivery error
backend_syslog.go:45: <info> syslog is not available: Unix syslog delivery error
backend_syslog.go:45: <info> syslog is not available: Unix syslog delivery error
backend_syslog.go:45: <info> syslog is not available: Unix syslog delivery error
E: lstat /lastore/override/desktop2uaid: no such file or directory
WARNING: apt does not have a stable CLI interface. Use with caution in scripts.
Removing intermediate container 09c23fb03c01
These are messages and warnings that, as commented here, are harmless.
Using docker build -t docker-deepin . also fails to build