I have been trying to share data between my host and docker container. I am using this command to mount data volume:
sudo docker run -it -v /home/peeyush/Docker/docker/:/opt/test/:rw ubuntu /bin/bash
Now, when I run docker and try to access /opt/test/, it says I don't have the permission. But I have already specified permission as read-write and I am root. Here is the output:
root#d61b3bfe0aab:/# ls /opt/test/
ls: cannot open directory /opt/test/: Permission denied
Any idea what am I doing wrong here?
Update: Here is the output of ls -al /home/peeyush/Docker/docker:
[peeyush#localhost docker]$ ls -al /home/peeyush/Docker/docker/
total 308
drwxrwxr-x. 29 peeyush peeyush 4096 Feb 24 14:14 .
drwxrwxr-x. 5 peeyush peeyush 4096 Feb 23 15:38 ..
drwxrwxr-x. 5 peeyush peeyush 4096 Feb 23 11:53 api
-rw-rw-r--. 1 peeyush peeyush 28898 Feb 23 11:53 AUTHORS
drwxrwxr-x. 4 peeyush peeyush 4096 Feb 23 11:53 builder
drwxrwxr-x. 2 peeyush peeyush 4096 Feb 23 11:53 builtins
drwxrwxr-x. 3 peeyush peeyush 4096 Feb 23 13:36 bundles
-rw-rw-r--. 1 peeyush peeyush 61942 Feb 23 11:53 CHANGELOG.md
drwxrwxr-x. 11 peeyush peeyush 4096 Feb 23 11:53 contrib
-rw-rw-r--. 1 peeyush peeyush 13305 Feb 23 11:53 CONTRIBUTING.md
drwxrwxr-x. 5 peeyush peeyush 4096 Feb 23 11:53 daemon
drwxrwxr-x. 2 peeyush peeyush 4096 Feb 23 11:53 docker
-rw-rw-r--. 1 peeyush peeyush 5423 Feb 24 14:14 Dockerfile
-rw-rw-r--. 1 peeyush peeyush 16 Feb 23 11:53 .dockerignore
drwxrwxr-x. 2 peeyush peeyush 4096 Feb 23 11:53 dockerinit
drwxrwxr-x. 5 peeyush peeyush 4096 Feb 23 11:53 docs
drwxrwxr-x. 2 peeyush peeyush 4096 Feb 23 11:53 engine
drwxrwxr-x. 2 peeyush peeyush 4096 Feb 23 11:53 events
drwxrwxr-x. 8 peeyush peeyush 4096 Feb 24 14:14 .git
-rw-rw-r--. 1 peeyush peeyush 489 Feb 23 11:53 .gitignore
drwxrwxr-x. 2 peeyush peeyush 4096 Feb 23 11:53 graph
lrwxrwxrwx. 1 peeyush peeyush 7 Feb 23 11:53 hack -> project
drwxrwxr-x. 3 peeyush peeyush 4096 Feb 23 11:53 image
drwxrwxr-x. 3 peeyush peeyush 4096 Feb 23 11:53 integration
drwxrwxr-x. 2 peeyush peeyush 4096 Feb 23 11:53 integration-cli
-rw-rw-r--. 1 peeyush peeyush 10763 Feb 23 11:53 LICENSE
drwxrwxr-x. 2 peeyush peeyush 4096 Feb 23 11:53 links
-rw-rw-r--. 1 peeyush peeyush 7171 Feb 23 11:53 .mailmap
-rw-rw-r--. 1 peeyush peeyush 18599 Feb 23 11:53 MAINTAINERS
-rw-rw-r--. 1 peeyush peeyush 3400 Feb 23 11:53 Makefile
drwxrwxr-x. 2 peeyush peeyush 4096 Feb 23 11:53 nat
-rw-rw-r--. 1 peeyush peeyush 638 Feb 23 11:53 NOTICE
drwxrwxr-x. 2 peeyush peeyush 4096 Feb 23 11:53 opts
drwxrwxr-x. 39 peeyush peeyush 4096 Feb 23 11:53 pkg
drwxrwxr-x. 3 peeyush peeyush 4096 Feb 23 11:53 project
-rw-rw-r--. 1 peeyush peeyush 10624 Feb 23 11:53 README.md
drwxrwxr-x. 3 peeyush peeyush 4096 Feb 23 11:53 registry
drwxrwxr-x. 2 peeyush peeyush 4096 Feb 23 11:53 runconfig
drwxrwxr-x. 2 peeyush peeyush 4096 Feb 23 11:53 trust
drwxrwxr-x. 2 peeyush peeyush 4096 Feb 23 11:53 utils
drwxrwxr-x. 3 peeyush peeyush 4096 Feb 23 11:53 vendor
-rw-rw-r--. 1 peeyush peeyush 10 Feb 23 11:53 VERSION
drwxrwxr-x. 2 peeyush peeyush 4096 Feb 23 11:53 volumes
And of ls -al /opt/:
root#d61b3bfe0aab:/# ls -al /opt/
total 12
drwxr-xr-x. 3 root root 4096 Feb 25 06:22 .
drwxr-xr-x. 21 root root 4096 Feb 25 06:58 ..
drwxrwxr-x. 29 1000 1000 4096 Feb 24 08:44 test
Thanks.
Using a distro with SELinux? You can try turning it to passive (setenforce 0) or try a :Z/:z at the end of the -v command like (/home/peeyush/Docker/docker:/opt/test:Z)
Would be interested to see if it works without the trailing '/'s on the directory paths, as I have never used them and never had this issue.
sudo docker run -it -v /home/peeyush/Docker/docker:/opt/test ubuntu /bin/bash
Related
jenkins home (JENKINS_HOME) directory contains ".java" with the following contents.
What is the purpose, who creates this?
[jenkins#jenkins data]$ ls -R -la .java
.java:
total 12
drwxr-xr-x 4 jenkins jenkins 47 Sep 24 2021 .
drwxr-xr-x 32 jenkins jenkins 8192 May 26 11:23 ..
drwxr-xr-x 6 jenkins jenkins 84 Apr 11 08:11 fonts
drwx------ 3 jenkins jenkins 88 Sep 24 2021 .userPrefs
.java/fonts:
total 16
drwxr-xr-x 6 jenkins jenkins 84 Apr 11 08:11 .
drwxr-xr-x 4 jenkins jenkins 47 Sep 24 2021 ..
drwxr-xr-x 2 jenkins jenkins 4096 Oct 22 2021 11.0.12
drwxr-xr-x 2 jenkins jenkins 4096 Feb 10 08:21 11.0.13
drwxr-xr-x 2 jenkins jenkins 4096 Mar 8 16:10 11.0.14
drwxr-xr-x 2 jenkins jenkins 4096 Apr 11 09:28 11.0.14.1
.java/fonts/11.0.12:
total 204
drwxr-xr-x 2 jenkins jenkins 4096 Oct 22 2021 .
drwxr-xr-x 6 jenkins jenkins 84 Apr 11 08:11 ..
-rw------- 1 jenkins jenkins 7299 Oct 22 2021 fcinfo-1-040d00baa2eb-Linux-3.10.0-1160.6.1.el7.x86_64-en.properties
-rw------- 1 jenkins jenkins 7299 Sep 14 2021 fcinfo-1-20ca101e47b5-Linux-3.10.0-1160.6.1.el7.x86_64-en.properties
-rw------- 1 jenkins jenkins 7299 Oct 22 2021 fcinfo-1-21c8cfa68082-Linux-3.10.0-1160.6.1.el7.x86_64-en.properties
-rw------- 1 jenkins jenkins 7299 Oct 22 2021 fcinfo-1-37affa299e53-Linux-3.10.0-1160.6.1.el7.x86_64-en.properties
-rw------- 1 jenkins jenkins 7299 Oct 22 2021 fcinfo-1-5711e7474638-Linux-3.10.0-1160.6.1.el7.x86_64-en.properties
-rw------- 1 jenkins jenkins 7299 Oct 22 2021 fcinfo-1-6b1683e97998-Linux-3.10.0-1160.6.1.el7.x86_64-en.properties
-rw------- 1 jenkins jenkins 7299 Sep 14 2021 fcinfo-1-728bf3c61133-Linux-3.10.0-1160.6.1.el7.x86_64-en.properties
-rw------- 1 jenkins jenkins 7299 Sep 30 2021 fcinfo-1-7b86df010aaf-Linux-3.10.0-1160.6.1.el7.x86_64-en.properties
-rw------- 1 jenkins jenkins 7299 Sep 28 2021 fcinfo-1-832b491f4c04-Linux-3.10.0-1160.6.1.el7.x86_64-en.properties
-rw------- 1 jenkins jenkins 7299 Oct 22 2021 fcinfo-1-86aba7d01298-Linux-3.10.0-1160.6.1.el7.x86_64-en.properties
-rw------- 1 jenkins jenkins 7299 Oct 22 2021 fcinfo-1-8932a30d6877-Linux-3.10.0-1160.6.1.el7.x86_64-en.properties
-rw------- 1 jenkins jenkins 7299 Sep 14 2021 fcinfo-1-96bd7f94e38b-Linux-3.10.0-1160.6.1.el7.x86_64-en.properties
-rw------- 1 jenkins jenkins 7299 Sep 14 2021 fcinfo-1-a1583396148a-Linux-3.10.0-1160.6.1.el7.x86_64-en.properties
-rw------- 1 jenkins jenkins 7299 Oct 22 2021 fcinfo-1-a1bb55b4d274-Linux-3.10.0-1160.6.1.el7.x86_64-en.properties
-rw------- 1 jenkins jenkins 7299 Oct 13 2021 fcinfo-1-a7f7f4177010-Linux-3.10.0-1160.6.1.el7.x86_64-en.properties
-rw------- 1 jenkins jenkins 7299 Oct 22 2021 fcinfo-1-b12b7fd6f0c7-Linux-3.10.0-1160.6.1.el7.x86_64-en.properties
-rw------- 1 jenkins jenkins 7299 Sep 28 2021 fcinfo-1-b1b0d9227a50-Linux-3.10.0-1160.6.1.el7.x86_64-en.properties
-rw------- 1 jenkins jenkins 7299 Sep 13 2021 fcinfo-1-b503c6b64359-Linux-3.10.0-1160.6.1.el7.x86_64-en.properties
-rw------- 1 jenkins jenkins 7299 Oct 1 2021 fcinfo-1-bc04fbd5ff6c-Linux-3.10.0-1160.6.1.el7.x86_64-en.properties
-rw------- 1 jenkins jenkins 7299 Oct 13 2021 fcinfo-1-dfeccf9ddb48-Linux-3.10.0-1160.6.1.el7.x86_64-en.properties
-rw------- 1 jenkins jenkins 7299 Sep 28 2021 fcinfo-1-e3c99d9e381b-Linux-3.10.0-1160.6.1.el7.x86_64-en.properties
-rw------- 1 jenkins jenkins 7299 Oct 13 2021 fcinfo-1-e8da60a9a257-Linux-3.10.0-1160.6.1.el7.x86_64-en.properties
-rw------- 1 jenkins jenkins 7299 Oct 22 2021 fcinfo-1-eaebb37b5977-Linux-3.10.0-1160.6.1.el7.x86_64-en.properties
-rw------- 1 jenkins jenkins 7299 Sep 14 2021 fcinfo-1-f32e3c0ebecd-Linux-3.10.0-1160.6.1.el7.x86_64-en.properties
-rw------- 1 jenkins jenkins 7299 Oct 22 2021 fcinfo-1-f9d0aa853241-Linux-3.10.0-1160.6.1.el7.x86_64-en.properties
.java/fonts/11.0.13:
total 172
drwxr-xr-x 2 jenkins jenkins 4096 Feb 10 08:21 .
drwxr-xr-x 6 jenkins jenkins 84 Apr 11 08:11 ..
-rw------- 1 jenkins jenkins 7299 Nov 22 2021 fcinfo-1-097221e8a108-Linux-3.10.0-1160.6.1.el7.x86_64-en.properties
-rw------- 1 jenkins jenkins 7299 Feb 10 07:58 fcinfo-1-41845738ebe1-Linux-3.10.0-1160.6.1.el7.x86_64-en.properties
-rw------- 1 jenkins jenkins 7299 Jan 4 12:34 fcinfo-1-46e0ccd45a88-Linux-3.10.0-1160.6.1.el7.x86_64-en.properties
-rw------- 1 jenkins jenkins 7299 Nov 12 2021 fcinfo-1-474a19c2cce4-Linux-3.10.0-1160.6.1.el7.x86_64-en.properties
-rw------- 1 jenkins jenkins 7299 Dec 7 09:09 fcinfo-1-614acd73e811-Linux-3.10.0-1160.6.1.el7.x86_64-en.properties
-rw------- 1 jenkins jenkins 7299 Jan 31 17:36 fcinfo-1-6962f56c161d-Linux-3.10.0-1160.6.1.el7.x86_64-en.properties
-rw------- 1 jenkins jenkins 7299 Dec 30 10:55 fcinfo-1-85261a0f7ec2-Linux-3.10.0-1160.6.1.el7.x86_64-en.properties
-rw------- 1 jenkins jenkins 7299 Nov 26 11:35 fcinfo-1-85956c8d5f07-Linux-3.10.0-1160.6.1.el7.x86_64-en.properties
-rw------- 1 jenkins jenkins 7299 Jan 27 10:22 fcinfo-1-88d1b31b3765-Linux-3.10.0-1160.6.1.el7.x86_64-en.properties
-rw------- 1 jenkins jenkins 7299 Dec 7 08:50 fcinfo-1-8f030abd9c75-Linux-3.10.0-1160.6.1.el7.x86_64-en.properties
-rw------- 1 jenkins jenkins 7299 Nov 24 2021 fcinfo-1-99beaa989281-Linux-3.10.0-1160.6.1.el7.x86_64-en.properties
-rw------- 1 jenkins jenkins 7299 Feb 10 07:23 fcinfo-1-ace5ac3b63e6-Linux-3.10.0-1160.6.1.el7.x86_64-en.properties
-rw------- 1 jenkins jenkins 7299 Feb 1 09:40 fcinfo-1-b0b039be646a-Linux-3.10.0-1160.6.1.el7.x86_64-en.properties
-rw------- 1 jenkins jenkins 7299 Jan 13 09:05 fcinfo-1-b2d98a3161f6-Linux-3.10.0-1160.6.1.el7.x86_64-en.properties
-rw------- 1 jenkins jenkins 7299 Nov 12 2021 fcinfo-1-c22fc2f4765b-Linux-3.10.0-1160.6.1.el7.x86_64-en.properties
-rw------- 1 jenkins jenkins 7299 Dec 7 09:00 fcinfo-1-d522e357e0ae-Linux-3.10.0-1160.6.1.el7.x86_64-en.properties
-rw------- 1 jenkins jenkins 7299 Jan 13 08:57 fcinfo-1-d8918f1e34ac-Linux-3.10.0-1160.6.1.el7.x86_64-en.properties
-rw------- 1 jenkins jenkins 7299 Nov 19 2021 fcinfo-1-dcb3e5ad8a04-Linux-3.10.0-1160.6.1.el7.x86_64-en.properties
-rw------- 1 jenkins jenkins 7299 Feb 10 07:37 fcinfo-1-f553c95bca98-Linux-3.10.0-1160.6.1.el7.x86_64-en.properties
-rw------- 1 jenkins jenkins 7299 Jan 13 09:13 fcinfo-1-f9e9b7738fab-Linux-3.10.0-1160.6.1.el7.x86_64-en.properties
-rw------- 1 jenkins jenkins 7299 Feb 10 08:21 fcinfo-1-facf3dc3fd74-Linux-3.10.0-1160.6.1.el7.x86_64-en.properties
.java/fonts/11.0.14:
total 36
drwxr-xr-x 2 jenkins jenkins 4096 Mar 8 16:10 .
drwxr-xr-x 6 jenkins jenkins 84 Apr 11 08:11 ..
-rw------- 1 jenkins jenkins 7299 Mar 8 08:06 fcinfo-1-3d402af251bf-Linux-3.10.0-1160.6.1.el7.x86_64-en.properties
-rw------- 1 jenkins jenkins 7299 Mar 8 08:19 fcinfo-1-4c7ea1c83a38-Linux-3.10.0-1160.6.1.el7.x86_64-en.properties
-rw------- 1 jenkins jenkins 7299 Mar 8 16:10 fcinfo-1-ccb90ea5dcfc-Linux-3.10.0-1160.6.1.el7.x86_64-en.properties
-rw------- 1 jenkins jenkins 7299 Mar 8 14:37 fcinfo-1-d59c3d909628-Linux-3.10.0-1160.6.1.el7.x86_64-en.properties
.java/fonts/11.0.14.1:
total 28
drwxr-xr-x 2 jenkins jenkins 4096 Apr 11 09:28 .
drwxr-xr-x 6 jenkins jenkins 84 Apr 11 08:11 ..
-rw------- 1 jenkins jenkins 7299 Apr 11 08:16 fcinfo-1-05e5f5147559-Linux-3.10.0-1160.6.1.el7.x86_64-en.properties
-rw------- 1 jenkins jenkins 7299 Apr 11 08:11 fcinfo-1-7d587d1071d0-Linux-3.10.0-1160.6.1.el7.x86_64-en.properties
-rw------- 1 jenkins jenkins 7299 Apr 11 09:28 fcinfo-1-837bffc706fb-Linux-3.10.0-1160.6.1.el7.x86_64-en.properties
.java/.userPrefs:
total 0
drwx------ 3 jenkins jenkins 88 Sep 24 2021 .
drwxr-xr-x 4 jenkins jenkins 47 Sep 24 2021 ..
drwxr-xr-x 3 jenkins jenkins 49 Sep 24 2021 org
-rw------- 1 jenkins jenkins 0 Sep 24 2021 .user.lock.jenkins
-rw------- 1 jenkins jenkins 0 Sep 24 2021 .userRootModFile.jenkins
.java/.userPrefs/org:
total 4
drwxr-xr-x 3 jenkins jenkins 49 Sep 24 2021 .
drwx------ 3 jenkins jenkins 88 Sep 24 2021 ..
drwxr-xr-x 3 jenkins jenkins 47 Sep 24 2021 codehaus
-rw-r--r-- 1 jenkins jenkins 148 Sep 24 2021 prefs.xml
.java/.userPrefs/org/codehaus:
total 4
drwxr-xr-x 3 jenkins jenkins 47 Sep 24 2021 .
drwxr-xr-x 3 jenkins jenkins 49 Sep 24 2021 ..
drwxr-xr-x 3 jenkins jenkins 46 Sep 24 2021 groovy
-rw-r--r-- 1 jenkins jenkins 148 Sep 24 2021 prefs.xml
.java/.userPrefs/org/codehaus/groovy:
total 4
drwxr-xr-x 3 jenkins jenkins 46 Sep 24 2021 .
drwxr-xr-x 3 jenkins jenkins 47 Sep 24 2021 ..
-rw-r--r-- 1 jenkins jenkins 148 Sep 24 2021 prefs.xml
drwxr-xr-x 3 jenkins jenkins 46 Sep 24 2021 tools
.java/.userPrefs/org/codehaus/groovy/tools:
total 4
drwxr-xr-x 3 jenkins jenkins 46 Sep 24 2021 .
drwxr-xr-x 3 jenkins jenkins 46 Sep 24 2021 ..
-rw-r--r-- 1 jenkins jenkins 148 Sep 24 2021 prefs.xml
drwxr-xr-x 2 jenkins jenkins 30 Sep 24 2021 shell
.java/.userPrefs/org/codehaus/groovy/tools/shell:
total 4
drwxr-xr-x 2 jenkins jenkins 30 Sep 24 2021 .
drwxr-xr-x 3 jenkins jenkins 46 Sep 24 2021 ..
-rw-r--r-- 1 jenkins jenkins 148 Sep 24 2021 prefs.xml
Step 3/10 : RUN mkdir -p /etc/nginx/{sites-available,sites-enabled}
Step 4/10 : COPY nginx.conf /etc/nginx/
Step 5/10 : COPY sites-available/*.conf /etc/nginx/sites-available/
Step 6/10 : RUN ln -s /etc/nginx/sites-available/* /etc/nginx/sites-enabled/
---> Running in a2f39a3fd6b3
ln: /etc/nginx/sites-enabled/: No such file or directory
ln: /etc/nginx/sites-enabled/: No such file or directory
ln: /etc/nginx/sites-enabled/: No such file or directory
ln: /etc/nginx/sites-enabled/: No such file or directory
ln: /etc/nginx/sites-enabled/: No such file or directory
ln: /etc/nginx/sites-enabled/: No such file or directory
ln: /etc/nginx/sites-enabled/: No such file or directory
ln: /etc/nginx/sites-enabled/: No such file or directory
The command '/bin/sh -c ln -s /etc/nginx/sites-available/* /etc/nginx/sites-enabled/*' returned a non-zero code: 1
Any clue why this isn't working? ^^
I tried all these commands outside of a docker container and it seemed to work
This could be solved by copying the files directly to the sites-enabled directory with the following statement:
COPY sites-available/*.conf /etc/nginx/sites-enabled/
Your step 3 includes a bashism:
mkdir -p /etc/nginx/{sites-available,sites-enabled}
With the default /bin/sh, this will create a single directory rather than the two directories you wanted:
$ docker run -it --rm nginx /bin/sh
# ls -al /etc/nginx
total 48
drwxr-xr-x 3 root root 4096 Dec 28 15:20 .
drwxr-xr-x 1 root root 4096 Jan 26 19:46 ..
drwxr-xr-x 2 root root 4096 Dec 28 15:20 conf.d
-rw-r--r-- 1 root root 1007 Nov 19 12:50 fastcgi_params
-rw-r--r-- 1 root root 2837 Nov 19 12:50 koi-utf
-rw-r--r-- 1 root root 2223 Nov 19 12:50 koi-win
-rw-r--r-- 1 root root 5231 Nov 19 12:50 mime.types
lrwxrwxrwx 1 root root 22 Nov 19 12:50 modules -> /usr/lib/nginx/modules
-rw-r--r-- 1 root root 643 Nov 19 12:50 nginx.conf
-rw-r--r-- 1 root root 636 Nov 19 12:50 scgi_params
-rw-r--r-- 1 root root 664 Nov 19 12:50 uwsgi_params
-rw-r--r-- 1 root root 3610 Nov 19 12:50 win-utf
# mkdir -p /etc/nginx/{sites-available,sites-enabled}
# ls -al /etc/nginx
total 56
drwxr-xr-x 1 root root 4096 Jan 26 19:47 .
drwxr-xr-x 1 root root 4096 Jan 26 19:46 ..
drwxr-xr-x 2 root root 4096 Dec 28 15:20 conf.d
-rw-r--r-- 1 root root 1007 Nov 19 12:50 fastcgi_params
-rw-r--r-- 1 root root 2837 Nov 19 12:50 koi-utf
-rw-r--r-- 1 root root 2223 Nov 19 12:50 koi-win
-rw-r--r-- 1 root root 5231 Nov 19 12:50 mime.types
lrwxrwxrwx 1 root root 22 Nov 19 12:50 modules -> /usr/lib/nginx/modules
-rw-r--r-- 1 root root 643 Nov 19 12:50 nginx.conf
-rw-r--r-- 1 root root 636 Nov 19 12:50 scgi_params
-rw-r--r-- 1 root root 664 Nov 19 12:50 uwsgi_params
-rw-r--r-- 1 root root 3610 Nov 19 12:50 win-utf
drwxr-xr-x 2 root root 4096 Jan 26 19:47 {sites-available,sites-enabled}
For /bin/sh, you need to list them individually:
# mkdir -p /etc/nginx/sites-available /etc/nginx/sites-enabled
# ls -al /etc/nginx
total 64
drwxr-xr-x 1 root root 4096 Jan 26 19:49 .
drwxr-xr-x 1 root root 4096 Jan 26 19:46 ..
drwxr-xr-x 2 root root 4096 Dec 28 15:20 conf.d
-rw-r--r-- 1 root root 1007 Nov 19 12:50 fastcgi_params
-rw-r--r-- 1 root root 2837 Nov 19 12:50 koi-utf
-rw-r--r-- 1 root root 2223 Nov 19 12:50 koi-win
-rw-r--r-- 1 root root 5231 Nov 19 12:50 mime.types
lrwxrwxrwx 1 root root 22 Nov 19 12:50 modules -> /usr/lib/nginx/modules
-rw-r--r-- 1 root root 643 Nov 19 12:50 nginx.conf
-rw-r--r-- 1 root root 636 Nov 19 12:50 scgi_params
drwxr-xr-x 2 root root 4096 Jan 26 19:49 sites-available
drwxr-xr-x 2 root root 4096 Jan 26 19:49 sites-enabled
-rw-r--r-- 1 root root 664 Nov 19 12:50 uwsgi_params
-rw-r--r-- 1 root root 3610 Nov 19 12:50 win-utf
drwxr-xr-x 2 root root 4096 Jan 26 19:47 {sites-available,sites-enabled}
I have a docker image built from an F# project that uses Paket. At run time the image fails with:
It was not possible to find any compatible framework version The
specified framework 'Microsoft.AspNetCore.App', version '2.2.7' was
not found.
My dockerfile looks like this:
# Two stage build because Paket means project files reference external files
# via <Import Project="..\.paket\Paket.Restore.targets" />
# https://github.com/fsprojects/Paket/issues/3006#issuecomment-359750323
FROM microsoft/dotnet:2.2-sdk-alpine AS build
RUN apk update \
&& apk add --no-cache bash
WORKDIR /app
# copy fsproj and restore as distinct layers
COPY MyCompany.WebApi/MyCompany.WebApi.fsproj ./MyCompany.WebApi/
COPY NuGet.config ./
RUN dotnet restore MyCompany.WebApi/MyCompany.WebApi.fsproj --configfile NuGet.config
# copy everything else and build
COPY . ./
RUN dotnet publish MyCompany.WebApi/MyCompany.WebApi.fsproj -c Release -o out
# build runtime image
FROM microsoft/dotnet:2.2-sdk-alpine AS final
RUN apk update \
&& apk add --no-cache bash
WORKDIR /app
COPY --from=build /app/MyCompany.WebApi/out ./
ENTRYPOINT ["dotnet", "MyCompany.WebApi.dll"]
Same problem occurs if I use 2.2-runtime-alpine as the basis for final.
My packet.lock includes these lines:
// https://github.com/fsharp/FAKE/issues/2193:
version 5.216.0
...
source https://api.nuget.org/v3/index.json
...
nuget Microsoft.AspNetCore.App
...
I notice that my generated paket.dependencies specifies a particular version of Microsoft.AspNetCore.App:
Microsoft.AspNetCore.App (2.2.7)
Microsoft.AspNet.WebApi.Client (>= 5.2.6 < 5.3) - restriction: >= netcoreapp2.2
Microsoft.AspNetCore (>= 2.2 < 2.3) - restriction: >= netcoreapp2.2
Microsoft.AspNetCore.Antiforgery (>= 2.2 < 2.3) - restriction: >= netcoreapp2.2
...although it looks like we are discouraged from specifying versions:
https://learn.microsoft.com/en-us/aspnet/core/fundamentals/metapackage-app?view=aspnetcore-2.2
So my question is: is it possible to come up with a combination of Docker, Paket, F# and AspNetCore that works together?
Edit: paket.dependencies -> packet.lock
Edit 2: Here's a listing of the entry point's directory and below:
.:
total 18668
-rwxr--r-- 1 root root 190976 Aug 29 13:18 Dapper.dll
-rwxr--r-- 1 root root 2850168 Aug 2 19:03 FSharp.Core.dll
-rwxr--r-- 1 root root 243200 Apr 16 08:00 Fable.Core.dll
-rwxr--r-- 1 root root 342528 Feb 10 2019 Giraffe.dll
...lots more DLLs from Nuget dependencies
... some DLLs from our internal dependencies
-rw-r--r-- 1 root root 100670 Sep 12 13:23 MyCompany.WebApi.deps.json
-rwxr-xr-x 1 root root 61440 Sep 12 13:23 MyCompany.WebApi.dll
-rw-r--r-- 1 root root 10608 Sep 12 13:23 MyCompany.WebApi.pdb
-rw-r--r-- 1 root root 149 Sep 12 13:23 MyCompany.WebApi.runtimeconfig.json
-rwxr--r-- 1 root root 178824 Nov 28 2018 System.Net.Http.Formatting.dll
-rwxr--r-- 1 root root 23088 Sep 18 2018 System.Runtime.CompilerServices.Unsafe.dll
-rwxr--r-- 1 root root 29744 Feb 15 2019 System.Security.Cryptography.OpenSsl.dll
-rwxr--r-- 1 root root 189168 Nov 29 2018 System.Security.Cryptography.Pkcs.dll
-rwxr--r-- 1 root root 29760 Jul 19 2018 System.ServiceModel.Primitives.dll
-rwxr--r-- 1 root root 30784 Jul 19 2018 System.ServiceModel.dll
-rwxr--r-- 1 root root 759024 Nov 29 2018 System.Text.Encoding.CodePages.dll
-rwxr--r-- 1 root root 91136 Sep 16 2018 TaskBuilder.fs.dll
drwxr-xr-x 2 root root 4096 Sep 12 13:23 cs
drwxr-xr-x 2 root root 4096 Sep 12 13:23 de
drwxr-xr-x 2 root root 4096 Sep 12 13:23 es
drwxr-xr-x 2 root root 4096 Sep 12 13:23 fr
drwxr-xr-x 2 root root 4096 Sep 12 13:23 it
drwxr-xr-x 2 root root 4096 Sep 12 13:23 ja
drwxr-xr-x 2 root root 4096 Sep 12 13:23 ko
drwxr-xr-x 2 root root 4096 Sep 12 13:23 pl
-rwxr--r-- 1 root root 277504 Aug 30 2018 protobuf-net.dll
drwxr-xr-x 2 root root 4096 Sep 12 13:23 pt-BR
drwxr-xr-x 2 root root 4096 Sep 12 13:23 ru
drwxr-xr-x 4 root root 4096 Sep 12 13:23 runtimes
drwxr-xr-x 2 root root 4096 Sep 12 13:23 tr
drwxr-xr-x 2 root root 4096 Sep 12 13:23 zh-Hans
drwxr-xr-x 2 root root 4096 Sep 12 13:23 zh-Hant
./cs:
total 376
-rwxr--r-- 1 root root 33144 Aug 2 19:03 FSharp.Core.resources.dll
-rwxr--r-- 1 root root 308088 Aug 8 16:19 Microsoft.CodeAnalysis.CSharp.resources.dll
-rwxr--r-- 1 root root 34896 Aug 8 16:18 Microsoft.CodeAnalysis.resources.dll
./de:
total 392
-rwxr--r-- 1 root root 34168 Aug 2 19:03 FSharp.Core.resources.dll
-rwxr--r-- 1 root root 327544 Aug 8 16:19 Microsoft.CodeAnalysis.CSharp.resources.dll
-rwxr--r-- 1 root root 36216 Aug 8 16:18 Microsoft.CodeAnalysis.resources.dll
./es:
total 388
-rwxr--r-- 1 root root 33360 Aug 2 19:03 FSharp.Core.resources.dll
-rwxr--r-- 1 root root 321104 Aug 8 16:19 Microsoft.CodeAnalysis.CSharp.resources.dll
-rwxr--r-- 1 root root 35920 Aug 8 16:18 Microsoft.CodeAnalysis.resources.dll
./fr:
total 392
-rwxr--r-- 1 root root 33656 Aug 2 19:03 FSharp.Core.resources.dll
-rwxr--r-- 1 root root 327544 Aug 8 16:19 Microsoft.CodeAnalysis.CSharp.resources.dll
-rwxr--r-- 1 root root 36432 Aug 8 16:18 Microsoft.CodeAnalysis.resources.dll
./it:
total 392
-rwxr--r-- 1 root root 33144 Aug 2 19:03 FSharp.Core.resources.dll
-rwxr--r-- 1 root root 325496 Aug 8 16:19 Microsoft.CodeAnalysis.CSharp.resources.dll
-rwxr--r-- 1 root root 36216 Aug 8 16:18 Microsoft.CodeAnalysis.resources.dll
./ja:
total 428
-rwxr--r-- 1 root root 35704 Aug 2 19:03 FSharp.Core.resources.dll
-rwxr--r-- 1 root root 358776 Aug 8 16:19 Microsoft.CodeAnalysis.CSharp.resources.dll
-rwxr--r-- 1 root root 38264 Aug 8 16:18 Microsoft.CodeAnalysis.resources.dll
./ko:
total 396
-rwxr--r-- 1 root root 34680 Aug 2 19:03 FSharp.Core.resources.dll
-rwxr--r-- 1 root root 331336 Aug 8 16:19 Microsoft.CodeAnalysis.CSharp.resources.dll
-rwxr--r-- 1 root root 36728 Aug 8 16:18 Microsoft.CodeAnalysis.resources.dll
./pl:
total 396
-rwxr--r-- 1 root root 34168 Aug 2 19:03 FSharp.Core.resources.dll
-rwxr--r-- 1 root root 331128 Aug 8 16:19 Microsoft.CodeAnalysis.CSharp.resources.dll
-rwxr--r-- 1 root root 36216 Aug 8 16:18 Microsoft.CodeAnalysis.resources.dll
./pt-BR:
total 380
-rwxr--r-- 1 root root 32632 Aug 2 19:03 FSharp.Core.resources.dll
-rwxr--r-- 1 root root 316280 Aug 8 16:19 Microsoft.CodeAnalysis.CSharp.resources.dll
-rwxr--r-- 1 root root 35704 Aug 8 16:18 Microsoft.CodeAnalysis.resources.dll
./ru:
total 508
-rwxr--r-- 1 root root 39800 Aug 2 19:03 FSharp.Core.resources.dll
-rwxr--r-- 1 root root 430968 Aug 8 16:19 Microsoft.CodeAnalysis.CSharp.resources.dll
-rwxr--r-- 1 root root 42360 Aug 8 16:18 Microsoft.CodeAnalysis.resources.dll
./runtimes:
total 8
drwxr-xr-x 3 root root 4096 Sep 12 13:23 unix
drwxr-xr-x 3 root root 4096 Sep 12 13:23 win
./runtimes/unix:
total 4
drwxr-xr-x 4 root root 4096 Sep 12 13:23 lib
./runtimes/unix/lib:
total 8
drwxr-xr-x 2 root root 4096 Sep 12 13:23 netcoreapp2.1
drwxr-xr-x 2 root root 4096 Sep 12 13:23 netstandard2.0
./runtimes/unix/lib/netcoreapp2.1:
total 88
-rwxr--r-- 1 root root 86280 Feb 15 2019 System.Security.Cryptography.OpenSsl.dll
./runtimes/unix/lib/netstandard2.0:
total 1848
-rwxr--r-- 1 root root 1889344 Jul 19 2018 System.Private.ServiceModel.dll
./runtimes/win:
total 4
drwxr-xr-x 5 root root 4096 Sep 12 13:23 lib
./runtimes/win/lib:
total 12
drwxr-xr-x 2 root root 4096 Sep 12 13:23 netcoreapp2.0
drwxr-xr-x 2 root root 4096 Sep 12 13:23 netcoreapp2.1
drwxr-xr-x 2 root root 4096 Sep 12 13:23 netstandard2.0
./runtimes/win/lib/netcoreapp2.0:
total 744
-rwxr--r-- 1 root root 761392 Nov 29 2018 System.Text.Encoding.CodePages.dll
./runtimes/win/lib/netcoreapp2.1:
total 212
-rwxr--r-- 1 root root 214064 Nov 29 2018 System.Security.Cryptography.Pkcs.dll
./runtimes/win/lib/netstandard2.0:
total 1848
-rwxr--r-- 1 root root 1889344 Jul 19 2018 System.Private.ServiceModel.dll
./tr:
total 376
-rwxr--r-- 1 root root 32632 Aug 2 19:03 FSharp.Core.resources.dll
-rwxr--r-- 1 root root 312184 Aug 8 16:19 Microsoft.CodeAnalysis.CSharp.resources.dll
-rwxr--r-- 1 root root 35192 Aug 8 16:18 Microsoft.CodeAnalysis.resources.dll
./zh-Hans:
total 344
-rwxr--r-- 1 root root 31096 Aug 2 19:03 FSharp.Core.resources.dll
-rwxr--r-- 1 root root 278904 Aug 8 16:19 Microsoft.CodeAnalysis.CSharp.resources.dll
-rwxr--r-- 1 root root 33144 Aug 8 16:18 Microsoft.CodeAnalysis.resources.dll
./zh-Hant:
total 344
-rwxr--r-- 1 root root 30584 Aug 2 19:03 FSharp.Core.resources.dll
-rwxr--r-- 1 root root 280144 Aug 8 16:19 Microsoft.CodeAnalysis.CSharp.resources.dll
-rwxr--r-- 1 root root 33360 Aug 8 16:18 Microsoft.CodeAnalysis.resources.dll
I think I've fixed this. Changed the base image to one I found referenced in a Microsoft tutorial, and removed the apk update stage (as this returned a non-zero exit code with this new base image). So this is my dockerfile now.
FROM mcr.microsoft.com/dotnet/core/sdk:2.2 AS build
WORKDIR /app
# copy fsproj and restore as distinct layers
COPY MyCompany.WebApi/MyCompany.WebApi.fsproj ./MyCompany.WebApi/
COPY NuGet.config ./
RUN dotnet restore MyCompany.WebApi/MyCompany.WebApi.fsproj --configfile NuGet.config
# copy everything else and build
COPY . ./
RUN dotnet publish MyCompany.WebApi/MyCompany.WebApi.fsproj -c Release -o out
# build runtime image
FROM mcr.microsoft.com/dotnet/core/aspnet:2.2 AS final
WORKDIR /app
COPY --from=build /app/MyCompany.WebApi/out ./
ENTRYPOINT ["dotnet", "MyCompany.WebApi.dll"]
It starts up OK now, haven't yet tested the functionality!
I am far from a Docker or Linux expert, but I would hazard a guess that the Alpine image hasn't caught up with the latest dotnet releases. I would also guess that the image I create after this change is fatter than it needs to be, but I'll take 'fat and working' for now.
i have a problem with my makefile. It will not set the opencv include directory.
Makefile:
# Basic Vars
VERSION = 0.01
BIN = ./bin64/
SOURCE = ../native/
# DC Lib files
OBJ = $(addprefix $(BIN), DCFile.o \
DCDirectory.o \
DCSettings.o \
DCArguments.o \
DCSupport.o \
DCSQLConnection.o \
DCSQLSMRndArticle.o \
DCSQLStatement.o \
DCMachineLearning.o \
DCNeuralNetwork.o \
DCMarkerDetection.o \
DCTire.o \
DCEllipse.o \
DCGabor.o \
DCDewarp.o \
DCRimTrainData.o \
DCRimTrainDataGrab.o \
DCRimTrainDataGrabHD.o \
DCRimDetector.o \
DCTool.o)
# TOOL Specifics
# Classificator:
OBJ_CF = ./Classificator/Classificator.o
NAME_CF = classificator
CC = g++
CFLAGS = -Wall -O2 -s -DNDEBUG -DVERSION=\"$(VERSION)\"
CFLAGS += -I/usr/local/include/opencv4
LDFLAGS = -lopencv_core -lopencv_videoio -lopencv_imgproc -lopencv_imgcodecs -lopencv_highgui -lopencv_ml -lopencv_calib3d -lopencv_features2d -lpthread -lmysqlcppconn -lmysqlcppconn8
# Build Rules
all: classificator
classificator: makedir $(OBJ) $(OBJ_CF)
$(CC) $(CFLAGS) -o $(BIN)$(NAME_CF) $(OBJ) $(OBJ_CF) $(LDFLAGS)
$(BIN)%.o: $(SOURCE)%.cpp
$(CC) $(CFLAGS) -c $< -o $# $(LDFLAGS)
makedir:
mkdir -p $(BIN)
clean:
rm -rf $(BIN)
definclude.h
#pragma once
// Basic
#include <stdio.h>
#include <iostream>
#include <fstream>
#include <cstdlib>
// Threading
#include <thread>
#include <chrono>
#include <mutex>
// OpenCV
#include <opencv2/opencv.hpp>
This massage was returned after this command:
make Classificator
g++ -c -o Classificator/Classificator.o
Classificator/Classificator.cpp In file included from
Classificator/../../native/DCSupport.h:3,
from Classificator/Classificator.cpp:4: Classificator/../../native/definclude.h:15:10: fatal error:
opencv2/core.hpp: Datei oder Verzeichnis nicht gefunden #include
^~~~~~~~~~~~~~~~~~
But the folder contains These files:
root#debian:/usr/local# dir /usr/local/include/opencv4/opencv2/ -l
insgesamt 1452
drwxr-sr-x 2 root staff 4096 Jun 12 10:23 aruco
-rw-r--r-- 1 root staff 31327 Jun 12 08:43 aruco.hpp
-rw-r--r-- 1 root staff 16481 Jun 12 08:43 bgsegm.hpp
drwxr-sr-x 2 root staff 4096 Jun 12 10:23 bioinspired
-rw-r--r-- 1 root staff 2716 Jun 12 08:43 bioinspired.hpp
drwxr-sr-x 2 root staff 4096 Jul 11 10:09 calib3d
-rw-r--r-- 1 root staff 182569 Jun 11 10:13 calib3d.hpp
drwxr-sr-x 2 root staff 4096 Jun 12 10:23 ccalib
-rw-r--r-- 1 root staff 6910 Jun 12 08:43 ccalib.hpp
drwxr-sr-x 7 root staff 4096 Jul 11 10:09 core
-rw-r--r-- 1 root staff 5550 Jun 12 08:43 core_detect.hpp
-rw-r--r-- 1 root staff 151515 Jun 11 10:13 core.hpp
-rw-r--r-- 1 root staff 3417 Jul 11 09:32 cvconfig.h
drwxr-sr-x 2 root staff 4096 Jun 12 10:23 datasets
drwxr-sr-x 3 root staff 4096 Jul 11 10:09 dnn
-rw-r--r-- 1 root staff 3347 Jun 11 10:13 dnn.hpp
-rw-r--r-- 1 root staff 6805 Jun 12 08:43 dpm.hpp
drwxr-sr-x 2 root staff 4096 Jun 12 10:23 face
-rw-r--r-- 1 root staff 17092 Jun 12 08:43 face.hpp
drwxr-sr-x 3 root staff 4096 Jul 11 10:09 features2d
-rw-r--r-- 1 root staff 65434 Jun 11 10:13 features2d.hpp
drwxr-sr-x 2 root staff 4096 Jul 11 10:09 flann
-rw-r--r-- 1 root staff 26646 Jul 11 09:30 flann.hpp
-rw-r--r-- 1 root staff 6900 Jun 12 08:43 freetype.hpp
drwxr-sr-x 2 root staff 4096 Jun 12 10:23 fuzzy
-rw-r--r-- 1 root staff 3385 Jun 12 08:43 fuzzy.hpp
drwxr-sr-x 8 root staff 4096 Jul 11 10:09 gapi
-rw-r--r-- 1 root staff 932 Jul 11 09:30 gapi.hpp
-rw-r--r-- 1 root staff 6177 Jun 12 08:43 hfs.hpp
drwxr-sr-x 2 root staff 4096 Jul 11 10:09 highgui
-rw-r--r-- 1 root staff 36215 Jun 11 10:13 highgui.hpp
drwxr-sr-x 3 root staff 4096 Jul 11 10:09 imgcodecs
-rw-r--r-- 1 root staff 16443 Jun 11 10:13 imgcodecs.hpp
drwxr-sr-x 2 root staff 4096 Jun 12 10:23 img_hash
-rw-r--r-- 1 root staff 2965 Jun 12 08:43 img_hash.hpp
drwxr-sr-x 4 root staff 4096 Jul 11 10:09 imgproc
-rw-r--r-- 1 root staff 228365 Jun 11 10:13 imgproc.hpp
drwxr-sr-x 2 root staff 4096 Jun 12 10:23 line_descriptor
-rw-r--r-- 1 root staff 6834 Jun 12 08:43 line_descriptor.hpp
drwxr-sr-x 2 root staff 4096 Jul 11 10:09 ml
-rw-r--r-- 1 root staff 92264 Jun 11 10:13 ml.hpp
drwxr-sr-x 2 root staff 4096 Jul 11 10:09 objdetect
-rw-r--r-- 1 root staff 36007 Jun 11 10:13 objdetect.hpp
-rw-r--r-- 1 root staff 4503 Aug 13 2018 opencv.hpp
-rw-r--r-- 1 root staff 752 Jul 11 09:32 opencv_modules.hpp
drwxr-sr-x 2 root staff 4096 Jun 12 10:23 optflow
-rw-r--r-- 1 root staff 14276 Jun 12 08:43 optflow.hpp
drwxr-sr-x 2 root staff 4096 Jun 12 10:23 phase_unwrapping
-rw-r--r-- 1 root staff 3196 Jun 12 08:43 phase_unwrapping.hpp
drwxr-sr-x 3 root staff 4096 Jul 11 10:09 photo
-rw-r--r-- 1 root staff 37887 Jun 11 10:13 photo.hpp
-rw-r--r-- 1 root staff 5346 Jun 12 08:43 plot.hpp
drwxr-sr-x 2 root staff 4096 Jun 12 10:23 quality
-rw-r--r-- 1 root staff 469 Jun 12 08:43 quality.hpp
drwxr-sr-x 2 root staff 4096 Jun 12 10:23 reg
drwxr-sr-x 2 root staff 4096 Jun 12 10:23 rgbd
-rw-r--r-- 1 root staff 669 Jun 12 08:43 rgbd.hpp
drwxr-sr-x 2 root staff 4096 Jun 12 10:23 saliency
-rw-r--r-- 1 root staff 4302 Jun 12 08:43 saliency.hpp
drwxr-sr-x 2 root staff 4096 Jun 12 10:23 shape
-rw-r--r-- 1 root staff 2461 Jun 12 08:43 shape.hpp
drwxr-sr-x 2 root staff 4096 Jun 12 10:23 stereo
-rw-r--r-- 1 root staff 14356 Jun 12 08:43 stereo.hpp
drwxr-sr-x 3 root staff 4096 Jul 11 10:09 stitching
-rw-r--r-- 1 root staff 13772 Jun 11 10:13 stitching.hpp
drwxr-sr-x 2 root staff 4096 Jun 12 10:23 structured_light
-rw-r--r-- 1 root staff 3525 Jun 12 08:43 structured_light.hpp
drwxr-sr-x 2 root staff 4096 Jun 12 10:23 superres
-rw-r--r-- 1 root staff 8287 Jun 12 08:43 superres.hpp
drwxr-sr-x 2 root staff 4096 Jun 12 10:23 surface_matching
-rw-r--r-- 1 root staff 22598 Jun 12 08:43 surface_matching.hpp
drwxr-sr-x 2 root staff 4096 Jun 12 10:23 text
-rw-r--r-- 1 root staff 5230 Jun 12 08:43 text.hpp
drwxr-sr-x 2 root staff 4096 Jun 12 10:23 tracking
-rw-r--r-- 1 root staff 11893 Jun 12 08:43 tracking.hpp
drwxr-sr-x 3 root staff 4096 Jul 11 10:09 video
-rw-r--r-- 1 root staff 2544 Aug 13 2018 video.hpp
drwxr-sr-x 3 root staff 4096 Jul 11 10:09 videoio
-rw-r--r-- 1 root staff 54206 Jun 11 10:13 videoio.hpp
drwxr-sr-x 2 root staff 4096 Jun 12 10:23 videostab
-rw-r--r-- 1 root staff 3674 Jun 12 08:43 videostab.hpp
drwxr-sr-x 2 root staff 4096 Jun 12 10:23 xfeatures2d
-rw-r--r-- 1 root staff 41604 Jun 12 08:43 xfeatures2d.hpp
drwxr-sr-x 2 root staff 4096 Jun 12 10:23 ximgproc
-rw-r--r-- 1 root staff 9756 Jun 12 08:43 ximgproc.hpp
-rw-r--r-- 1 root staff 3445 Jun 12 08:43 xobjdetect.hpp
drwxr-sr-x 2 root staff 4096 Jun 12 10:23 xphoto
-rw-r--r-- 1 root staff 2508 Jun 12 08:43 xphoto.hpp
root#debian:/usr/local#
What should i do to solve this Problem?
Thanks!
I think the problem is with the way make processes the target $(OBJ_CF). That expands to...
./Classificator/Classificator.o
which doesn't match the defined rule...
$(BIN)%.o: $(SOURCE)%.cpp
Hence make will fall back on the builtin rule to compile a c++ file which will invoke...
$(CXX) $(CPPFLAGS) $(CXXFLAGS) -c
So either define your own rule for ./Classificator/Classificator.o or set CPPFLAGS accordingly...
CPPFLAGS += -I/usr/local/include/opencv4
Xcode version 6.2 building for iOS 8.2. I have an application that builds and runs in the iphone and ipad simulator but when I try to build and deploy to a real i-device the compile fails.
The header files under netinet in these 2 directories are vastly different:
`
ls -al /Applications/Xcode.app//Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/usr/include/netinet
total 40
drwxr-xr-x 6 root wheel 204 Mar 19 11:02 ./
drwxr-xr-x 154 root wheel 5236 Mar 19 11:01 ../
-rw-r--r-- 1 root wheel 27431 Mar 10 11:29 in.h
-rw-r--r-- 1 root wheel 4001 Mar 10 11:29 in_systm.h
-rw-r--r-- 1 root wheel 8097 Mar 10 11:29 ip.h
-rw-r--r-- 1 root wheel 8946 Mar 10 11:29 tcp.h
`
ls -al /Applications/Xcode.app//Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/usr/include/netinet
total 72
drwxr-xr-x 24 root wheel 816 Feb 10 00:56 ./
drwxr-xr-x 206 root wheel 7004 Mar 10 11:31 ../
-rw-r--r-- 1 root wheel 4165 Mar 10 11:30 bootp.h
-rw-r--r-- 1 root wheel 24679 Mar 10 11:30 icmp6.h
-rw-r--r-- 1 root wheel 4577 Mar 10 11:30 icmp_var.h
-rw-r--r-- 1 root wheel 5832 Mar 10 11:30 if_ether.h
-rw-r--r-- 1 root wheel 7093 Mar 10 11:30 igmp.h
-rw-r--r-- 1 root wheel 5839 Mar 10 11:30 igmp_var.h
-rw-r--r-- 1 root wheel 27431 Mar 10 11:30 in.h
-rw-r--r-- 1 root wheel 9496 Mar 10 11:30 in_pcb.h
-rw-r--r-- 1 root wheel 4001 Mar 10 11:30 in_systm.h
-rw-r--r-- 1 root wheel 5574 Mar 10 11:30 in_var.h
-rw-r--r-- 1 root wheel 8097 Mar 10 11:30 ip.h
-rw-r--r-- 1 root wheel 11034 Mar 10 11:30 ip6.h
-rw-r--r-- 1 root wheel 9471 Mar 10 11:30 ip_icmp.h
-rw-r--r-- 1 root wheel 6237 Mar 10 11:30 ip_var.h
-rw-r--r-- 1 root wheel 8946 Mar 10 11:30 tcp.h
-rw-r--r-- 1 root wheel 5181 Mar 10 11:30 tcp_fsm.h
-rw-r--r-- 1 root wheel 4484 Mar 10 11:30 tcp_seq.h
-rw-r--r-- 1 root wheel 6772 Mar 10 11:30 tcp_timer.h
-rw-r--r-- 1 root wheel 22554 Mar 10 11:30 tcp_var.h
-rw-r--r-- 1 root wheel 4271 Mar 10 11:30 tcpip.h
-rw-r--r-- 1 root wheel 3694 Mar 10 11:30 udp.h
-rw-r--r-- 1 root wheel 5659 Mar 10 11:30 udp_var.h
I can work around it by creating links that point to the simulator header files but that feels wrong.
Is there a reason for what I'm seeing?