8

I have ubuntu docker container. I installed there some applicaiton compiled in windows for ubuntu.

It does not execute and I'd like to check if there is a mismatch between the system architecture and the file. I try this command

> file myapp

but unfortunately output is

> bash: file: command not found

Really, in bin directory there is no "file" command. Is it somewhere else or I need I install it?

enter image description here

  • 5
    Do a which file and if no result then its not there install it.. remember your using a docker container it might not have all you need! – George Udosen Feb 9 '17 at 9:58
  • 1
    Did you install the package coreutils in your container? Try sudo apt-get install coreutils and see the result. – Koala Yeung Feb 9 '17 at 10:08
  • @KoalaYeung it's not in core-utils, the package is file – Zanna Feb 9 '17 at 10:42
  • @Zanna when a program is core-utils its result would be /sbin/file right? – George Udosen Feb 9 '17 at 10:43
  • @George looks to me like the core-utils stuff is in /bin – Zanna Feb 9 '17 at 10:46
17

Docker images typically do not contain more than the bare essentials, and it seemed whoever created this container didn't deem file necessary. You'll have to install it, the package is also called file.

  • 1
    Don't forget to apt-get update before apt-get install file – Fernando Fabreti Apr 25 '19 at 20:07

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.