Troubleshooting installation pt 2 containers

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??

there are two steps

docker build -t friendlyhello .

and then

docker run -p 4000:80 friendlyhello

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

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

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’.

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

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

now we need to see the dockerfile

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

uh… maybe cut/paste error?

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

er? what do you mean sorry ohhhh wait

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

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 –

and when u run docker build now?

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

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?

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

use google to search for that

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

now you used _t… come on…