Docker Community Forums

Share and learn in the Docker community.

Build first app with dockerfile

I need create docker image (using dockerfile):

I want build my app on Ubutnu 18.04.

So, I have application in catalog my_app. In this catalog I have buildmyappimage(It’s .sh file) in which I have two lines:

# path to file where I run my_app which have name my_app_ver1.1
my_app/ my_app_ver1.1

in my_app/ I have builder my python APP. Whats more, I need openssl-1.0.2g

Please verify my dockerfile, It’s enough?

FROM ubutnu:18.04
FROM python:3.7
RUN apt-get update
RUN wget \
tar -xvf openssl-1.0.2g.tar.gz && rm openssl-1.0.2.g.tar.gz
RUN cd /openssl-1.0.2.g && ./Configure && make && make test && make install
CMD /my_app/buildcmsimage

#1. you have two base image delcarations, which will lead to a mutli-stage image build. Effecticly the first from has a typo and is completly useseles, as the second base image declaration completley replaces it.

#2. Your second RUN delcaration will fail as the line break needs to be followed by ‘&&’ (execute next command if the previous succeeded.)

#3. you have to use the COPY declaration to copy your content into the image.

#4. if you skipped #3, what do you expect your CMD declaration is going to execute?

General: does it realy make sense to you to ask people how the outcome of a docker build would be instead of just running the build and posting the issues at hand?!