Docker Community Forums

Share and learn in the Docker community.

Troubleshooting installation pt 2 containers


(Yehoshua Cane) #1

I’m just getting started, following the directions as per this page:

I’m using a dell studio laptop, running linux mint 18.3.

docker version 1.13.1

when I give the command: docker run -p 4000:80 friendlyhello; I get this error message:

josh@oem-Studio-1537 ~ $ docker build -t friendlyhello
"docker build" requires exactly 1 argument(s).
See ‘docker build --help’.

Usage: docker build [OPTIONS] PATH | URL | -

Build an image from a Dockerfile

… help??


(Sam) #2

there are two steps

docker build -t friendlyhello .

and then

docker run -p 4000:80 friendlyhello

(Yehoshua Cane) #3

yes but how to get past that first error message? build an image from a docker file? which file where


(Sam) #4

note that the docker build has a DOT (.) at the end, which means from HERE
i cut/pasted from the link you referenced

docker build looks for the file ‘Dockerfile’ in the folder referenced by the last parameter


(Yehoshua Cane) #5

at the end of the friendlyhello?

just tried that here is the output:

sudo docker build -t friendlyhello.
[sudo] password for josh:
invalid argument “friendlyhello.” for t: Error parsing reference: “friendlyhello.” is not a valid repository/tag: invalid reference format
See ‘docker build --help’.


(Sam) #6

cut/paste from the doc
needs to be a SPACE before the dot


(Yehoshua Cane) #7

sudo docker build -t friendlyhello .
Sending build context to Docker daemon 3.072 kB
Error response from daemon: Unknown instruction: E

when I do the command without sudo:
docker build -t friendlyhello .
Got permission denied while trying to connect to the Docker daemon socket at unix:///var/run/docker.sock: Post http://%2Fvar%2Frun%2Fdocker.sock/v1.26/build?buildargs=%7B%7D&cachefrom=%5B%5D&cgroupparent=&cpuperiod=0&cpuquota=0&cpusetcpus=&cpusetmems=&cpushares=0&dockerfile=Dockerfile&labels=%7B%7D&memory=0&memswap=0&networkmode=default&rm=1&shmsize=0&t=friendlyhello&ulimits=null: dial unix /var/run/docker.sock: connect: permission denied


(Sam) #8

now we need to see the dockerfile


(Yehoshua Cane) #9

e an official Python runtime as a parent image
FROM python:2.7-slim

Set the working directory to /app

WORKDIR /app

Copy the current directory contents into the container at /app

ADD . /app

Install any needed packages specified in requirements.txt

RUN pip install --trusted-host pypi.python.org -r requirements.txt

Make port 80 available to the world outside this container

EXPOSE 80

Define environment variable

ENV NAME World

Run app.py when the container launches

CMD [“python”, “app.py”]

~### this is what I copy and pasted into the Dockerfile. as per instructions on the same page


(Sam) #10

uh… maybe cut/paste error?

# Use an official Python runtime as a parent image
FROM python:2.7-slim

(Yehoshua Cane) #11

er? what do you mean sorry ohhhh wait


(Sam) #12

the 1st line of your dockerfile starts 'e an official’
but the documentation is different… as I posted


(Yehoshua Cane) #13

new paste

Set the working directory to /app

WORKDIR /app

Copy the current directory contents into the container at /app

ADD . /app

Install any needed packages specified in requirements.txt

RUN pip install --trusted-host pypi.python.org -r requirements.txt

Make port 80 available to the world outside this container

EXPOSE 80

Define environment variable

ENV NAME World

Run app.py when the container launches

CMD [“python”, “app.py”]
an official Python runtime as a parent image
FROM python:2.7-slim

Set the working directory to /app

WORKDIR /app

Copy the current directory contents into the container at /app

ADD . /app

Install any needed packages specified in requirements.txt

RUN pip install --trusted-host pypi.python.org -r requirements.txt

Make port 80 available to the world outside this container

EXPOSE 80

Define environment variable

ENV NAME World

Run app.py when the container launches

CMD [“python”, “app.py”]

– INSERT –


(Sam) #14

and when u run docker build now?


(Yehoshua Cane) #15

ok getting the same permission denied message

docker build -t friendlyhello .
Got permission denied while trying to connect to the Docker daemon socket at unix:///var/run/docker.sock: Post http://%2Fvar%2Frun%2Fdocker.sock/v1.26/build?buildargs=%7B%7D&cachefrom=%5B%5D&cgroupparent=&cpuperiod=0&cpuquota=0&cpusetcpus=&cpusetmems=&cpushares=0&dockerfile=Dockerfile&labels=%7B%7D&memory=0&memswap=0&networkmode=default&rm=1&shmsize=0&t=friendlyhello&ulimits=null: dial unix /var/run/docker.sock: connect: permission denied


(Sam) #16

that is without sudo (required unless u are root or added to the docker group…)

and u deleted the ‘from…’ line in the dockerfile… need that

how come you can’t cut/paste exactly what is provided?


(Yehoshua Cane) #17

ahh I should use sudo, how do I add my name to the docker group?


(Sam) #18

use google to search for that


(Yehoshua Cane) #19

sudo docker build _t friendlyhello .
“docker build” requires exactly 1 argument(s).
See ‘docker build --help’.

Usage: docker build [OPTIONS] PATH | URL | -

Build an image from a Dockerfile


(Sam) #20

now you used _t… come on…