I am new to docker and currently struggling with the following problem:
After starting the command in the docker terminal:
OAUTH_CLIENT_ID=<...> OAUTH_CLIENT_SECRET=<...>
OAUTH_URL_CALLBACK=http://192.168.99.100/api/v1/auth/login docker-compose --
file test/docker-compose.yml up
I get the following error message:
ERROR: for platform Cannot start service platform: invalid header field
value "oci runtime error: container_linux.go:247: starting container process
caused \"process_linux.go:359: container init caused \\\"rootfs_linux.go:53:
mounting \\\\\\\"/c/users/m_konk01/documents/GitHub/o2r-
platform/test/nginx.conf\\\\\\\" to rootfs
\\\\\\\"/mnt/sda1/var/lib/docker/aufs/mnt/29c14c514916cf09070c6dd084bee55fa899d9
79b3f7b9521f1ab25e3a8232a0\\\\\\\" at
\\\\\\\"/mnt/sda1/var/lib/docker/aufs/mnt/29c14c514916cf09070c6dd084bee55fa899d9
79b3f7b9521f1ab25e3a8232a0/etc/nginx/nginx.conf\\\\\\\" caused \\\\\\\"not
a directory\\\\\\\"\\\"\"\n" [31mERROR[0m: Encountered errors while bringing up the project.
The docker-compose.yml starts several docker containers and contains the following platform settings:
platform:
image: nginx:latest
depends_on:
- container1
- container2
- container3
- container4
volumes:
- "./nginx.conf:/etc/nginx/nginx.conf:ro"
- "../client:/etc/nginx/html"
ports:
- "80:80"
Docker version
$ docker version
Client:
Version: 1.12.3
API version: 1.24
Go version: go1.6.3
Git commit: 6b644ec
Built: Wed Oct 26 23:26:11 2016
OS/Arch: windows/amd64
Server:
Version: 1.12.3
API version: 1.24
Go version: go1.6.3
Git commit: 6b644ec
Built: Wed Oct 26 23:26:11 2016
OS/Arch: linux/amd64
Would be happy for any ideas. My search was not successful so far.
it seems like you want to mount a file to a file. i remember on your docker-version its not allowed. you have to move your nginx.conf inside of your Dockerfile
Dockerfile:
....
ADD nginx.conf /tmp/
RUN mv /tmp/nginx.conf /etc/nginx/nginx.conf && \
....
this should work for you. if not show me your next error code
I faced similar issue due to volume mount was not worked properly.
So docker default behavior consider this /nginx.conf as directory and gives this error.
To confirm this, you can ssh into your image and go to shared directory and check the files exist or not.
Example: docker exec -it nginx sh and go to /etc/nginx/html you won't see your local files. Then you can confirm volume share was not working. you need to fix that.
If you are using windows 10 (hyper-v), first you need to share your drive and check.
However you need to find the solution to mound your shared directory first.
Related
I need to build a Docker image for Windows platform containing an ASP.Net Framework 4.8 application using Github Action.
In build step, it throws an error
Building Docker image *** with tags latest...
WARNING: No output specified with docker-container driver. Build result will only remain in the build cache. To push result image into registry use --push or to load image into docker use --load
#1 [internal] booting buildkit
#1 pulling image moby/buildkit:buildx-stable-1
#1 pulling image moby/buildkit:buildx-stable-1 0.2s done
#1 creating container buildx_buildkit_builder-b7ba0de1-52b2-435b-aa7d-8311039928160 done
#1 ERROR: Error response from daemon: Windows does not support privileged mode
------
> [internal] booting buildkit:
------
ERROR: Error response from daemon: Windows does not support privileged mode
In the post
Github Action for Windows platform "Windows does not support privileged mode"
the author says he solved the problem by changing the build action to mr-smithers-excellent/docker-build-push#v5 but it didn't work for me.
My script:
build:
runs-on: windows-latest
steps:
- uses: actions/checkout#v3
- name: Setup MSBuild
uses: microsoft/setup-msbuild#v1
- name: Docker Setup Buildx
uses: docker/setup-buildx-action#v2.0.0
with:
install: true
- name: Build Docker images
uses: mr-smithers-excellent/docker-build-push#v5.8
with:
image: ******
tags: latest
registry: *****
dockerfile: *****
My Dockerfile
FROM mcr.microsoft.com/dotnet/framework/aspnet:4.8-windowsservercore-ltsc2019
ARG source
WORKDIR /inetpub/wwwroot
COPY ${source:-obj/Docker/publish} .
cmd
I have a docker-compose file where I start the database and the asp.net server with dotnet watch run like this:
backend:
image: mcr.microsoft.com/dotnet/sdk:6.0
depends_on:
- db
environment:
DB_HOST: db
DB_NAME: db
DB_USERNAME: ${DB_USER}
DB_PASSWORD: ${DB_PW}
ASPNETCORE_ENVIRONMENT: Development
ports:
- 7293:7293
volumes:
- ./:/app
working_dir: /app
command: 'dotnet watch run --urls "http://0.0.0.0:7293"'
As you can see I mount the entire project directory in the container.
Now this runs fine and reloads on changes.
But as soon as the container starts in Visual Studio all the references to Nuget packages get marked red and can't be resolved anymore.
There is a .dockerignore file but I don't think anything in here is really relevant. But here is it anyways:
.dockerignore:
**/.classpath
**/.dockerignore
**/.env
**/.git
**/.gitignore
**/.project
**/.settings
**/.toolstarget
**/.vs
**/.vscode
**/*.*proj.user
**/*.dbmdl
**/*.jfm
**/azds.yaml
**/bin
**/charts
**/docker-compose*
**/Dockerfile*
**/node_modules
**/npm-debug.log
**/obj
**/secrets.dev.yaml
**/values.dev.yaml
LICENSE
README.md
I know this has something to do with project restore but nothing I tried helped. --no-restore made it just not run at all with an exception that it couldn't find the reference to one of the packages.
Any ideas how to avoid this?
Ok I figured it out. Mounting Apperently doesn't care about .dockerignore. I have to exclude the obj directory in the mount. So I just mount a empty directory like this.
backend:
...
volumes:
- ./:/app
- /app/obj # <- directory won't be mounted
working_dir: /app
command: 'dotnet watch run --urls "http://0.0.0.0:7293"'
I'm trying to follow along this blog about using Docker with R.
I followed basic Docker set up steps and am able to run the hello world image.
I'm on a old 2009 Mac and had to use Docker Toolbox.
I'm in a place with weak internet connection and am using a personal hotspot.
Each time I try to run docker run --rm -p 8787:8787 rocker/verse I wait for a few minutes and see a downloading message, then I get a message "docker: unauthorized: authentication required."
I found this separate documentation which advised me to add a password:
docker run --rm -p 8787:8787 -e PASSWORD=blah rocker/rstudio
But I got the same result "docker: unauthorized: authentication required."
I did some Google searching and found some posts both here on SO and on Github but was unable to identify what is causing this error in my specific case.
I suspect my weak internet connection might have something to do with it since I seem to be able to download for about 10 or 15 minutes before seeing this message.
Here is Docker info:
Macs-MacBook:~ macuser$ docker info
Containers: 1
Running: 0
Paused: 0
Stopped: 1
Images: 2
Server Version: 18.09.6
Storage Driver: overlay2
Backing Filesystem: extfs
Supports d_type: true
Native Overlay Diff: true
Logging Driver: json-file
Cgroup Driver: cgroupfs
Plugins:
Volume: local
Network: bridge host macvlan null overlay
Log: awslogs fluentd gcplogs gelf journald json-file local logentries splunk syslog
Swarm: inactive
Runtimes: runc
Default Runtime: runc
Init Binary: docker-init
containerd version: bb71b10fd8f58240ca47fbb579b9d1028eea7c84
runc version: 2b18fe1d885ee5083ef9f0838fee39b62d653e30
init version: fec3683
Security Options:
seccomp
Profile: default
Kernel Version: 4.14.116-boot2docker
Operating System: Boot2Docker 18.09.6 (TCL 8.2.1)
OSType: linux
Architecture: x86_64
CPUs: 1
Total Memory: 1.951GiB
Name: default
ID: XMCE:OBLV:CKEX:EGIB:PHQ7:MLHF:ZJSA:PGYN:OIMM:JI67:ETCI:JKBH
Docker Root Dir: /mnt/sda1/var/lib/docker
Debug Mode (client): false
Debug Mode (server): false
Registry: https://index.docker.io/v1/
Labels:
provider=virtualbox
Experimental: false
Insecure Registries:
127.0.0.0/8
Live Restore Enabled: false
Does anyone know where I can look to next in order to be able to pull and or run the rocker image?
I'm trying to run a web application in a docker container, that as part of it's bootstrap it goes to get some information from services reachable through an open vpn.
The host machine is Mac and i couldn't find any way to do so.
The web application is jetty app running in docker-compose.
I need that other containers will be able to link to the webapp.
any idea ...?
Docker version:
Client:
Version: 17.12.0-ce
API version: 1.35
Go version: go1.9.2
Git commit: c97c6d6
Built: Wed Dec 27 20:03:51 2017
OS/Arch: darwin/amd64
Server:
Engine:
Version: 17.12.0-ce
API version: 1.35 (minimum version 1.12)
Go version: go1.9.2
Git commit: c97c6d6
Built: Wed Dec 27 20:12:29 2017
OS/Arch: linux/amd64
Experimental: true
I think you need to specify the path on your config file on your docker-compose.yaml so then you will be able to have it configure .
etc I guess something like https://github.com/kylemanna/docker-openvpn/blob/master/docs/docker-compose.md
Hope that helps!
I'm running Docker on CentOS 7, from time to time there's the following message displayed:
Message from syslogd#dev-master at Mar 29 17:23:03 ...
kernel:unregister_netdevice: waiting for lo to become free. Usage count = 1
I've googled a lot, read a lot of resources found and tried many ways like keeping my system updated, upgrading kernel etc, but the message still keeps showing up, it's not too often but sooner or later I'll see it. Also I found issue for this problem on docker github is still open, then my questions are:
What does this message mean? Could somebody give me a simple explanation why docker causes it?
Is there any workaround for this?
If it could not be fixed yet(the issue is still open), will it affect the server or services running inside docker container? Will it be a serious performance issue because it also happens on our production servers?
Docker version:
Client:
Version: 1.11.1
API version: 1.23
Go version: go1.5.4
Git commit: 5604cbe
Built: Wed Apr 27 00:34:42 2016
OS/Arch: linux/amd64
Server:
Version: 1.11.1
API version: 1.23
Go version: go1.5.4
Git commit: 5604cbe
Built: Wed Apr 27 00:34:42 2016
OS/Arch: linux/amd64
OS info:
CentOS 7, with kernel version: 4.6.0-1.el7.elrepo.x86_64
I really appreciate for any info/tips or resources, thanks a lot.
Your best source of information is the issue you linked to docker#5618. This is a kernel bug, and has not yet been resolved. The issue is "triggered" by docker because starting/stopping containers also creates network interfaces for containers when they are created/destroyed.