GithubHelp home page GithubHelp logo

Comments (5)

mviereck avatar mviereck commented on June 19, 2024

It is possible to set this once at the beginning with

ENV DEBIAN_FRONTEND=noninteractive

This has the drawback that the variable is finally set in container, too.
There it can cause issues using interactive terminal commands that behave different if DEBIAN_FRONTEND is set. For example, an application might skip [Yes|no] questions.

So I decided to use instead:

'env DEBIAN_FRONTEND=noninteractive apt-get [...]'

This way the variable is set for this one command only.

from dockerfile-x11docker-deepin.

hongyi-zhao avatar hongyi-zhao commented on June 19, 2024

If so, why not use it as following in the Dockerfile:

# set DEBIAN_FRONTEND
ENV DEBIAN_FRONTEND=noninteractive

# ... do stuff that needs the DEBIAN_FRONTEND during the build with apt-get.

# unset DEBIAN_FRONTEND
ENV DEBIAN_FRONTEND ""
#or
#ENV DEBIAN_FRONTEND ''
#or
#ENV DEBIAN_FRONTEND= 

from dockerfile-x11docker-deepin.

mviereck avatar mviereck commented on June 19, 2024
# unset DEBIAN_FRONTEND
ENV DEBIAN_FRONTEND ""

This does not unset the variable but sets it to an empty string. The variable itself remains.
docker would need an UNSET instruction to really unset a variable.
I am not sure if or how behaviour for set but empty DEBIAN_FRONTEND is defined.
Setting it only where needed is the cleanest way for sure.

from dockerfile-x11docker-deepin.

hongyi-zhao avatar hongyi-zhao commented on June 19, 2024

docker would need an UNSET instruction to really unset a variable.

Do you mean I should write the instruction as shown below:

UNSET ENV DEBIAN_FRONTEND

I tried the above form and docker build will throw out the following error and terminate:

$ docker build --network host -f Dockerfiles/lion . -t deepin/lion
Sending build context to Docker daemon  35.84kB
Error response from daemon: Dockerfile parse error line 82: unknown instruction: UNSET

from dockerfile-x11docker-deepin.

mviereck avatar mviereck commented on June 19, 2024

docker does not have an UNSET instruction. That is why I set the variable for each command where it is needed.

from dockerfile-x11docker-deepin.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.