dockerfile

Docker - ERROR: failed to register layer: symlink

断了今生、忘了曾经 提交于 2021-02-20 06:25:30
问题 I'm running a docker-compose file we have, I usually run it with command: docker-compose up But today I'm getting this error. ERROR: failed to register layer: symlink ../bdf441e8145a625c4ab289f13ac2274b37d35475b97680f50b7eccda4328f973/diff /var/lib/docker/overlay2/l/7O5XKRTJV6RMTXBV5DTPDOHYNX: no such file or directory 回答1: To solve this issue, you just Stop and Start docker service from terminal. # service docker stop # service docker start 回答2: Followed this answer just restarting docker

Why is a folder created by WORKDIR owned by root instead of USER

五迷三道 提交于 2021-02-19 03:59:48
问题 I have the following Dockerfile ARG DEV_USER=dev # Other stuff ... USER $DEV_USER # Other stuff ... WORKDIR /home/$DEV_USER/Projects When I start a container and execute ls /home/dev , the Projects folder is owned by root . Does WORKDIR ignore the fact that USER was invoked earlier? 回答1: I failed to find detail documents for this, but I'm interested on this, so I just had a look for docker source code, I guess we can get the clue from sourcecode: moby/builder/dockerfile/dispatcher.go (Line

How to add private nuget source in dotnet dockerfile?

大城市里の小女人 提交于 2021-02-19 01:59:50
问题 I try to add (override) a private nuget source to my build script in order to add the user/pw - and keep it out of my source control. What I tried so far: nuget is not recognized as command inside the image dotnet nuget does not have the command to add additional sources installing nuget does not effect dotnet restore FROM mcr.microsoft.com/dotnet/core/sdk:2.2 RUN apt-get update && apt-get install -y nuget RUN nuget source Add -Name "Private Feed" -Source ".." -UserName "UserVAR" -Password

How can I start spring boot application in docker with profile?

旧时模样 提交于 2021-02-18 22:43:31
问题 I have a simple spring-boot project: -resources -application.yaml -application-test.yaml And I have this Dockerfile : FROM openjdk:8-jdk-alpine EXPOSE 8080 ADD micro-boot.jar micro-boot.jar ENTRYPOINT ["java","-Dspring.profiles.active=test" "-jar","/micro-boot.jar"] 1) I build image - C:\micro-boot>docker build -f Dockerfile -t micro-boot . 2) show all images - C:\micro-boot>docker image ls -a micro-boot latest ccc9a75ebc24 4 seconds ago 112MB 3) try to start C:\micro-boot>docker image ls -a

Why do some Docker images have no VOLUME defined?

醉酒当歌 提交于 2021-02-18 18:23:11
问题 I am just starting with Docker, please pardon me if my question is too silly for you. I see some images, like nginx , does not have any VOLUME defined whereas some images like mysql has VOLUME defined in their Dockerfile. How the data or files are managed when there is no volume defined, and what would be their working directory? 回答1: A preferred pattern for many applications you can run in a container is to store no state at all locally. If I have a Web application, and perhaps it takes a

Php7 Redis Client on Alpine OS

丶灬走出姿态 提交于 2021-02-18 13:37:07
问题 I crafted a docker image using alpine 3.5 as base Image. I want my php apllication running inside container to communicate with a redis server.But I don't find any php7-redis client in Alpine. Is there a workway around it ?I tried to use pecl to install redis but there is no pecl package in alpine.I tried with pear but pear doesn't have redis package. Any thoughts on this issue ? 回答1: You can find your solution here https://pkgs.alpinelinux.org/package/edge/community/x86_64/php7-redis 回答2:

Php7 Redis Client on Alpine OS

一笑奈何 提交于 2021-02-18 13:36:12
问题 I crafted a docker image using alpine 3.5 as base Image. I want my php apllication running inside container to communicate with a redis server.But I don't find any php7-redis client in Alpine. Is there a workway around it ?I tried to use pecl to install redis but there is no pecl package in alpine.I tried with pear but pear doesn't have redis package. Any thoughts on this issue ? 回答1: You can find your solution here https://pkgs.alpinelinux.org/package/edge/community/x86_64/php7-redis 回答2:

Permission problem: How to setup permissions on docker for windows for use with Wordpress

空扰寡人 提交于 2021-02-18 07:22:11
问题 The problem I'm trying to setup my developing environment using Docker for Windows for use with Wordpress. I'm using docker compose with a custom Dockerfile. This works perfectly on MacOS. Using the exact same docker setup on Windows though gets me these messages within Wordpress. Trying to upload media Trying to update Wordpress Clearly, Worpress doesn't have the correct file permissions. What I tried 1. Checking Docker for Windows settings and upgrading to WSL 2 I'm using the WSL 2 based

--mount=type=cache in buildkit

自作多情 提交于 2021-02-18 06:57:12
问题 I'm trying to get maven offline builds working from within a docker container. I've enabled buildkit. I've run mvn dependency:go-offline -s ~/checkouts/settings.xml to cache the dependencies in /root/.m2 of host machine. I wish to use this inside the container that builds maven project. Here is my Dockerfile: #syntax=docker/dockerfile:experimental FROM maven:3.6.1-jdk-11 AS build WORKDIR / COPY . / RUN --mount=type=cache,target=/root/.m2 mvn -o install FROM scratch COPY --from=build /admin

docker compose up working fine but browser showing site can't be reached

有些话、适合烂在心里 提交于 2021-02-17 07:02:39
问题 docker-compose up showing this: Recreating tutorial_product-service_1 ... Recreating tutorial_product-service_1 ... done Attaching to tutorial_product-service_1 product-service_1 | * Running on http://0.0.0.0:80/ (Press CTRL+C to quit) product-service_1 | * Restarting with stat product-service_1 | * Debugger is active! product-service_1 | * Debugger PIN: 192-693-276 and my docker-compose.yml version: '3' services: product-service: container_name: tutorial_product-service_1 build: ./product