1

I'm using a dockerfile to build an image:

FROM ubuntu:18.04

ENV DEBIAN_FRONTEND=noninteractive

RUN apt update
COPY ./scratch-desktop_3.3.0_amd64.deb /opt/scratch3-desktop.deb
RUN dpkg -i /opt/scratch3-desktop.deb
RUN apt-get install -f

CMD [ "scratch-desktop" ]

But when i use docker-compose build command, It raises an error on stage of installing Debian package,

dpkg: dependency problems prevent configuration of scratch-desktop:
 scratch-desktop depends on libgtk-3-0; however:
  Package libgtk-3-0 is not installed.
 scratch-desktop depends on libnotify4; however:
  Package libnotify4 is not installed.
 scratch-desktop depends on libnss3; however:
  Package libnss3 is not installed.
 scratch-desktop depends on libxss1; however:
  Package libxss1 is not installed.
 scratch-desktop depends on libxtst6; however:
  Package libxtst6 is not installed.
 scratch-desktop depends on xdg-utils; however:
  Package xdg-utils is not installed.
 scratch-desktop depends on kde-cli-tools | kde-runtime | trash-cli | libglib2.0-bin | gvfs-bin; however:
  Package kde-cli-tools is not installed.
  Package kde-runtime is not installed.
  Package trash-cli is not installed.
  Package libglib2.0-bin is not installed.
  Package gvfs-bin is not installed.

dpkg: error processing package scratch-desktop (--install):
 dependency problems - leaving unconfigured
Errors were encountered while processing:
 scratch-desktop
ERROR: Service 'scratch' failed to build: The command '/bin/sh -c dpkg -i /opt/scratch3-desktop.deb' returned a non-zero code: 1

1 Answer 1

2

Use

RUN apt-get install -y /opt/scratch3-desktop.deb

instead of RUN dpkg -i ....

1
  • Thanks It works, but Also no need to use sudo here, because It opens terminal as root.
    – CC7052
    Mar 13, 2021 at 14:37

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .