Home > Back-end >  Entrypoint clause not working in the dockerfile
Entrypoint clause not working in the dockerfile

Time:07-26

I'm trying to build a container using this docker file

FROM ubuntu:16.04

RUN apt-get update && apt-get install -y --no-install-recommends \
    python3.5 \
    python3-pip \

ENTRYPOINT ["/bin/bash"]

For some reason the ENTRYPOINT using ["/bin/bash"] is not being recognize.

When i build the container without the ENTRYPOINT i can run it with no problem using this command with the /bin/bash at the end

docker run -ti -d --name ubunto-teste_2 --rm ubuntu:16.04 /bin/bash

I'm learning linux and docker so i doesn't now much

The error i'm getting is this one

[ ] Building 48.2s (5/5) FINISHED
 => [internal] load build definition from Dockerfile                                                                                       0.1s
 => => transferring dockerfile: 191B                                                                                                       0.0s
 => [internal] load .dockerignore                                                                                                          0.1s
 => => transferring context: 2B                                                                                                            0.0s
 => [internal] load metadata for docker.io/library/ubuntu:16.04                                                                            0.0s
 => CACHED [1/2] FROM docker.io/library/ubuntu:16.04                                                                                       0.0s
 => ERROR [2/2] RUN apt-get update && apt-get install -y --no-install-recommends     python3.5     python3-pip ENTRYPOINT ["/bin/bash"]   48.0s
------
 > [2/2] RUN apt-get update && apt-get install -y --no-install-recommends     python3.5     python3-pip ENTRYPOINT ["/bin/bash"]:
#5 0.893 Get:1 http://security.ubuntu.com/ubuntu xenial-security InRelease [99.8 kB]
#5 0.899 Get:2 http://archive.ubuntu.com/ubuntu xenial InRelease [247 kB]
#5 1.724 Get:3 http://security.ubuntu.com/ubuntu xenial-security/main amd64 Packages [2051 kB]
#5 2.052 Get:4 http://archive.ubuntu.com/ubuntu xenial-updates InRelease [99.8 kB]
#5 2.445 Get:5 http://archive.ubuntu.com/ubuntu xenial-backports InRelease [97.4 kB]
#5 2.658 Get:6 http://archive.ubuntu.com/ubuntu xenial/main amd64 Packages [1558 kB]
#5 3.286 Get:7 http://security.ubuntu.com/ubuntu xenial-security/restricted amd64 Packages [15.9 kB]
#5 3.289 Get:8 http://security.ubuntu.com/ubuntu xenial-security/universe amd64 Packages [984 kB]
#5 3.368 Get:9 http://security.ubuntu.com/ubuntu xenial-security/multiverse amd64 Packages [8820 B]
#5 6.859 Get:10 http://archive.ubuntu.com/ubuntu xenial/restricted amd64 Packages [14.1 kB]
#5 6.888 Get:11 http://archive.ubuntu.com/ubuntu xenial/universe amd64 Packages [9827 kB]
#5 33.97 Get:12 http://archive.ubuntu.com/ubuntu xenial/multiverse amd64 Packages [176 kB]
#5 34.43 Get:13 http://archive.ubuntu.com/ubuntu xenial-updates/main amd64 Packages [2560 kB]
#5 41.23 Get:14 http://archive.ubuntu.com/ubuntu xenial-updates/restricted amd64 Packages [16.4 kB]
#5 41.28 Get:15 http://archive.ubuntu.com/ubuntu xenial-updates/universe amd64 Packages [1544 kB]
#5 45.48 Get:16 http://archive.ubuntu.com/ubuntu xenial-updates/multiverse amd64 Packages [26.2 kB]
#5 45.55 Get:17 http://archive.ubuntu.com/ubuntu xenial-backports/main amd64 Packages [10.9 kB]
#5 45.57 Get:18 http://archive.ubuntu.com/ubuntu xenial-backports/universe amd64 Packages [12.7 kB]
#5 45.66 Fetched 19.3 MB in 45s (429 kB/s)
#5 45.66 Reading package lists...
#5 46.60 Reading package lists...
#5 47.59 Building dependency tree...
#5 47.73 Reading state information...
#5 47.75 E: Unable to locate package ENTRYPOINT
#5 47.75 E: Unable to locate package [/bin
#5 47.75 E: Couldn't find any package by glob '[/bin'
#5 47.75 E: Regex compilation error - Unmatched [ or [^
#5 47.75 E: Couldn't find any package by regex '[/bin'
------
executor failed running [/bin/sh -c apt-get update && apt-get install -y --no-install-recommends     python3.5     python3-pip ENTRYPOINT ["/bin/bash"]]: exit code: 100

I think is has something to do with the end of line sequence

CodePudding user response:

The backslash after python3-pip looks wrong to me. It means that the line is being continued, which makes the word ENTRYPOINT part of the RUN command.

  • Related