Reputation: 913
I am new to Docker and am trying to set up an automatic build of my Github Repo:
https://github.com/satishsa1107/perl_helloworld
I added a Dockerfile with the following code:
FROM satishsa1107/perl_helloworld:latest
CMD perl hello.pl
My DockerHub is setup here:
docker.io/satishsa1107/perl_helloworld
When I try to build it, I get the following error:
Sending build context to Docker daemon 58.37 kB Sending build context to Docker daemon 58.37 kB
Step 1 : FROM satishsa1107/perl_helloworld:latest
Pulling repository docker.io/satishsa1107/perl_helloworld
Tag latest not found in repository docker.io/satishsa1107/perl_helloworld
ERROR: Build process returned exit code 1
ERROR: Build in 'master' (ef8abd92) failed in 0:00:16
I don't get it because when I set up my build settings in DockerHub, I added the following settings:
Type Name Dockerfile Location Docker Tag Name
branch master / latest
I assumed this meant that it was tagging my master branch in my Github Repo as latest, and I could refer to it as satishsa1107/perl_helloworld:latest but doesn't seem to be working.
Also, in DockerHub I see tags as empty. What am I doing wrong?
Upvotes: 0
Views: 1119
Reputation: 7510
The FROM
statement is always the base image you want to use to compile your own image, so in this case Docker is looking for the image docker.io/satishsa1107/perl_helloworld:latest in order to compile your image, so it won't work.
I recommend you to read more about the Dockerfile here: https://docs.docker.com/engine/reference/builder/
A possible option for your FROM
command is to reference the standard Perl as stated here: https://hub.docker.com/_/perl/
The Dockerfile would look like:
FROM perl:5.20
COPY . /usr/src/myapp
WORKDIR /usr/src/myapp
CMD [ "perl", "./hello.pl" ]
Upvotes: 2