0

My Dockerfile looks like below:

FROM scratch 
RUN skype

I have skype installed in my OS and when I try to build the docker with below command:

sudo docker build -t tryskyped .

It says

Sending build context to Docker daemon  2.048kB
Step 1/2 : FROM scratch
 ---> 
Step 2/2 : RUN skype
 ---> Running in 0ecf7c719567
container_linux.go:247: starting container process caused "exec: \"/bin/sh\": stat /bin/sh: no such file or directory"
oci runtime error: container_linux.go:247: starting container process caused "exec: \"/bin/sh\": stat /bin/sh: no such file or directory"

If I am not wrong it should have executed like /bin/sh -c skype. When I manually try this , I can see the skype opens
I am very new to this and I am just trying out docker.Please help

1 Answers1

0

Your Dockerfile does nothing, as it does not have a CMD or ENTRYPOINT to execute. A Dockerfile has a configuration phase (the RUN, ADD, COPY and so) and a start phase, with ENTRYPOINT and CMD As an example, the last line of the Dockerfile for the Nginx image reference contains

extract from

https://github.com/nginxinc/docker-nginx/blob/0c7611139f2ce7c5a6b1febbfd5b436c8c7d2d53/mainline/jessie/Dockerfile

CMD ["nginx", "-g", "daemon off;"]

Check What is the difference between CMD and ENTRYPOINT in a Dockerfile?

The doc for CMD

https://docs.docker.com/engine/reference/builder/#cmd

for ENTRYPOINT

https://docs.docker.com/engine/reference/builder/#entrypoint

Community
  • 1
  • 1
user2915097
  • 30,758
  • 6
  • 57
  • 59
  • and I did'nt notice but you can't `RUN` anything when using `FROM scratch` you have to add, install, configure a few things – user2915097 Apr 20 '17 at 11:30
  • you have to install skype in your Dockerfile, buid a new image, and so, see for example https://hub.docker.com/r/tianon/skype/~/dockerfile/ – user2915097 Apr 20 '17 at 11:37
  • How do I create a docker image without any os? I want a docker image which I can give to someone with same OS and it should work. – Shrihari Balasubramani Apr 20 '17 at 12:08
  • This is the beauty of docker, you find a great tuto for a software running Linux Suse for example and you run Debian, but you do not care, you create a docker image with a Dockerfile starting with `FROM suse` (or you have a Ubuntu and the tutorial is about CentOS...). You can use any OS, as long as it has a minimum kernel version – user2915097 Apr 20 '17 at 12:34
  • I mean I want to create a image without any OS layer. With this , I might be able to share all my installed python packages with my colleague – Shrihari Balasubramani Apr 20 '17 at 12:37
  • 1
    as you will need Python, you should read http://yasermartinez.com/blog/posts/creating-super-small-docker-images.html – user2915097 Apr 20 '17 at 12:39
  • Evn with that link, I can see he is adding busybox. What I want to is just share all my installed packages, so my colleagues can install the same by running docker on their NATIVE host – Shrihari Balasubramani Apr 20 '17 at 12:43
  • Let us [continue this discussion in chat](http://chat.stackoverflow.com/rooms/142180/discussion-between-shrihari-iyer-and-user2915097). – Shrihari Balasubramani Apr 20 '17 at 12:45