-2

How do I install (anything) on debian: 'apt is unknown instruction' in Dockerfile

If I search: [how to install wget on debian]

I get articles that say:

$sudo apt install wget


So I try to do that in Docker:

FROM debain
apt install wget

and I get this error

/full/path/to/current/working/directory                          
[+] Building 0.1s (2/2) FINISHED                                                                                                  
 => [internal] load build definition from Dockerfile                                                                         0.0s 
 => => transferring dockerfile: 102B                                                                                         0.0s 
 => [internal] load .dockerignore                                                                                            0.0s 
 => => transferring context: 2B                                                                                              0.0s 
failed to solve with frontend dockerfile.v0: failed to create LLB definition: dockerfile parse error line 2: unknown instruction: 
                                                                                                                                  
APT                                                                                                                               
/full/path/to/current/working/directory
                                                                         

--

what could be the problem here?

user10664542
  • 1,106
  • 1
  • 23
  • 43

1 Answers1

1

You need to add the RUN instruction, like this:

FROM debian
RUN apt install wget
assli100
  • 555
  • 3
  • 12