dockerfile

cant install pip in ubuntu 18.04 docker /bin/sh: 1: pip: not found

巧了我就是萌 提交于 2021-02-07 20:18:47
问题 I am getting the error using pip in my docker image. FROM ubuntu:18.04 RUN apt-get update && apt-get install -y \ software-properties-common RUN add-apt-repository universe RUN apt-get install -y \ python3.6 \ python3-pip ENV PYTHONUNBUFFERED 1 RUN mkdir /api WORKDIR /api COPY . /api/ RUN pip install pipenv RUN ls RUN pipenv sync I installed python 3.6 and pip3 but getting Step 9/11 : RUN pip install pipenv ---> Running in b184de4eb28e /bin/sh: 1: pip: not found 回答1: To run pip for python3

cant install pip in ubuntu 18.04 docker /bin/sh: 1: pip: not found

心不动则不痛 提交于 2021-02-07 20:02:12
问题 I am getting the error using pip in my docker image. FROM ubuntu:18.04 RUN apt-get update && apt-get install -y \ software-properties-common RUN add-apt-repository universe RUN apt-get install -y \ python3.6 \ python3-pip ENV PYTHONUNBUFFERED 1 RUN mkdir /api WORKDIR /api COPY . /api/ RUN pip install pipenv RUN ls RUN pipenv sync I installed python 3.6 and pip3 but getting Step 9/11 : RUN pip install pipenv ---> Running in b184de4eb28e /bin/sh: 1: pip: not found 回答1: To run pip for python3

Docker: failed to export image: failed to create image: failed to get layer

∥☆過路亽.° 提交于 2021-02-07 12:18:42
问题 I got the following error: failed to export image: failed to create image: failed to get layer sha256:xxxxxxxxxxxxx: layer does not exist Dockerfile : FROM openjdk:8 COPY ./lib/ /usr/src/app/BOOT-INF/lib/ COPY ./lib/entities-1.0-SNAPSHOT.jar /usr/src/app/BOOT-INF/lib/entities-1.0-SNAPSHOT.jar COPY ./app/ /usr/src/app/ WORKDIR /usr/src CMD ["java", "-cp", "app/", "org.springframework.boot.loader.JarLauncher"] Output : Step 3/6 : COPY ./lib/entities-1.0-SNAPSHOT.jar /usr/src/entities-1.0

Docker: failed to export image: failed to create image: failed to get layer

纵然是瞬间 提交于 2021-02-07 12:16:39
问题 I got the following error: failed to export image: failed to create image: failed to get layer sha256:xxxxxxxxxxxxx: layer does not exist Dockerfile : FROM openjdk:8 COPY ./lib/ /usr/src/app/BOOT-INF/lib/ COPY ./lib/entities-1.0-SNAPSHOT.jar /usr/src/app/BOOT-INF/lib/entities-1.0-SNAPSHOT.jar COPY ./app/ /usr/src/app/ WORKDIR /usr/src CMD ["java", "-cp", "app/", "org.springframework.boot.loader.JarLauncher"] Output : Step 3/6 : COPY ./lib/entities-1.0-SNAPSHOT.jar /usr/src/entities-1.0

standard_init_linux.go:211: exec user process caused “no such file or directory” [duplicate]

南楼画角 提交于 2021-02-07 09:47:33
问题 This question already has answers here : standard_init_linux.go:190: exec user process caused “no such file or directory” - Docker (13 answers) Closed 1 year ago . I am building the docker image of my project using the Dockerfile provided with it but docker container is always remains in restarting state. Below is the container log which I see:- standard_init_linux.go:211: exec user process caused "no such file or directory" Can some one prove me with the possible solution to it and also tell

Using docker swarm to execute singular containers rather than “services”

牧云@^-^@ 提交于 2021-02-07 04:01:58
问题 I really enjoy the concept of having a cluster of docker machines available to execute docker services. I also like the additional features not available to singular docker containers (such as docker secret). But I really have no need for long-standing services. My use case is to simply execute a bash script to use the docker swarm to take in an arbitrary number of finite commands, and execute each as a running docker container on the same docker image, while using the secrets loaded up with

SSH agent forwarding during docker build

爱⌒轻易说出口 提交于 2021-02-06 09:51:35
问题 While building up a docker image through dockerfile, I have to clone a github repo. I have added my public ssh keys to my git hub account and i am able to clone the repo from my docker host. While i see that i can use docker host's ssh key by mapping $SSH_AUTH_SOCK env variable at the time of docker run like docker run --rm -it --name container_name \ -v $(dirname $SSH_AUTH_SOCK):$(dirname $SSH_AUTH_SOCK) \ -e SSH_AUTH_SOCK=$SSH_AUTH_SOCK my_image . How can i do same during docker build ? 回答1

$PWD is not set in ENV instruction in a Dockerfile

梦想的初衷 提交于 2021-02-06 02:27:11
问题 I have a Dockerfile starts like this: FROM ubuntu:16.04 WORKDIR /some/path COPY . . ENV PYTHONUSERBASE=$PWD/pyenv PATH=$PWD/pyenv/bin:$PATH RUN echo "PWD is: $PWD" RUN echo "PYENV is: $PYTHONUSERBASE" I found $PWD (or ${PWD} ) was not set when I run docker build , as a comparison, $PATH was correctly expanded. Moreover, $PWD in RUN has no problem (It prints /some/path in this case) So the output of the given Dockerfile would be: PWD is: /some/path PYENV is: /pyenv Could somebody tell me why

$PWD is not set in ENV instruction in a Dockerfile

最后都变了- 提交于 2021-02-06 02:25:18
问题 I have a Dockerfile starts like this: FROM ubuntu:16.04 WORKDIR /some/path COPY . . ENV PYTHONUSERBASE=$PWD/pyenv PATH=$PWD/pyenv/bin:$PATH RUN echo "PWD is: $PWD" RUN echo "PYENV is: $PYTHONUSERBASE" I found $PWD (or ${PWD} ) was not set when I run docker build , as a comparison, $PATH was correctly expanded. Moreover, $PWD in RUN has no problem (It prints /some/path in this case) So the output of the given Dockerfile would be: PWD is: /some/path PYENV is: /pyenv Could somebody tell me why

Tag all stages of docker multi-stage build

假如想象 提交于 2021-02-05 08:17:07
问题 Is there a way to build and tag all stages of a multistage build? A verbose (and somewhat slow) workaround is to call docker build several times: DOCKER_BUILDKIT=1 docker build --target builder --tag bdr DOCKER_BUILDKIT=1 docker build --target build --tag bd DOCKER_BUILDKIT=1 docker build --target runtime --tag rt DOCKER_BUILDKIT=1 docker build --target test --tag tst EDIT: In my case every call to docker build includes ~2 seconds of overhead: #1 [internal] load .dockerignore #1 transferring