webapp doesn't exist with Azure CLI 2.0.79 - azure

I have upgraded recently to 2.0.79 due to the problems with 2.0.78 caused with static HTML pages
I am following this Microsoft tutorial but keep getting the error
"webapp anotherwebapp doesn't exist"
when I enter the command:
az webapp up --location westeurope --name anotherwebapp --html
The contents on the directory is listed below (dir):
08/01/2020 08:27 PM <DIR> .
08/01/2020 08:27 PM <DIR> ..
08/01/2020 08:27 PM 4,447 .gitignore
08/01/2020 08:27 PM <DIR> css
08/01/2020 08:27 PM <DIR> fonts
08/01/2020 08:27 PM <DIR> img
08/01/2020 08:27 PM 2,338 index.html
08/01/2020 08:27 PM <DIR> js
08/01/2020 08:27 PM 1,183 LICENSE
08/01/2020 08:27 PM 608 README.md
4 File(s) 8,576 bytes
6 Dir(s) 1,214,520,279,040 bytes free
Any help with resolving this would be much appreciated!

First, are you sure "webapp anotherwebapp doesn't exist" is an error message? it should be a prompt since it actually does not exist.
I can successfully deploy it with 2.0.79, and the steps are as below:
1.Install azure cli 2.0.79 via downloading the .msi, then restarts the machcine.
2.Then in cmd prompt, nav to the folder where my html project resides -> run the command:
az webapp up --location westeurope --name anotherwebapp111 --html
The screenshot as below:
3.Nav to azure portal, I can see the site is deployed successfully.

Related

Unable to access WebGL app as Azure Web App

I'm trying to deploy a Unity WebGL app to Azure to run as a Web App. But I cannot get the app to deploy. I am using the latest version of Unity (2022.1.3f1).
I have built the app, and here are the contents of my `Build`` directory:
# Build> ll
-rw-r--r-- 1 DKS0510862 staff 3664517 Jun 9 11:12 DSG Westy Unity PoC.data.gz
-rw-r--r-- 1 DKS0510862 staff 78822 Jun 9 11:14 DSG Westy Unity PoC.framework.js.gz
-rw-r--r--# 1 DKS0510862 staff 20484 Jun 9 11:09 DSG Westy Unity PoC.loader.js
-rw-r--r-- 1 DKS0510862 staff 7390463 Jun 9 11:14 DSG Westy Unity PoC.wasm.gz
In VS Code, I am navigating to the Build directory, right-clicking on the directory, and then selecting Deploy to Web App. I am logged in to Azure, and I am prompted to select the App Service that I created in Azure, so my connection is okay.
The deployment seems to have run successfully.
4:02:14 PM innovation-unity-poc-dev: Starting deployment...
4:02:18 PM innovation-unity-poc-dev: Creating zip package...
4:02:22 PM innovation-unity-poc-dev: Zip package size: 10.9 MB
4:02:24 PM innovation-unity-poc-dev: Updating submodules.
4:02:24 PM innovation-unity-poc-dev: Preparing deployment for commit id '38620705e7'.
4:02:24 PM innovation-unity-poc-dev: Generating deployment script.
4:02:24 PM innovation-unity-poc-dev: Using the following command to generate deployment script: 'azure site deploymentscript -y --no-dot-deployment -r "C:\local\Temp\zipdeploy\extracted" -o "C:\home\site\deployments\tools" --basic --sitePath "C:\local\Temp\zipdeploy\extracted"'.
4:02:26 PM innovation-unity-poc-dev: Generating deployment script for Web Site
4:02:27 PM innovation-unity-poc-dev: Generated deployment script files
4:02:27 PM innovation-unity-poc-dev: Running deployment command...
4:02:27 PM innovation-unity-poc-dev: Command: "C:\home\site\deployments\tools\deploy.cmd"
4:02:30 PM innovation-unity-poc-dev: Handling Basic Web Site deployment.
4:02:30 PM innovation-unity-poc-dev: Creating app_offline.htm
4:02:30 PM innovation-unity-poc-dev: KuduSync.NET from: 'C:\local\Temp\zipdeploy\extracted' to: 'C:\home\site\wwwroot'
4:02:30 PM innovation-unity-poc-dev: Deleting file: 'hostingstart.html'
4:02:30 PM innovation-unity-poc-dev: Copying file: 'DSG Westy Unity PoC.data.gz'
4:02:30 PM innovation-unity-poc-dev: Copying file: 'DSG Westy Unity PoC.framework.js.gz'
4:02:30 PM innovation-unity-poc-dev: Copying file: 'DSG Westy Unity PoC.loader.js'
4:02:30 PM innovation-unity-poc-dev: Copying file: 'DSG Westy Unity PoC.wasm.gz'
4:02:30 PM innovation-unity-poc-dev: Deleting app_offline.htm
4:02:30 PM innovation-unity-poc-dev: Finished successfully.
4:02:30 PM innovation-unity-poc-dev: Running post deployment command(s)...
4:02:30 PM innovation-unity-poc-dev: Triggering recycle (preview mode disabled).
4:02:30 PM innovation-unity-poc-dev: Deployment successful.
4:03:18 PM: Deployment to "innovation-unity-poc-dev" completed.
However, when I try to connect to the app, in the browser I am seeing the error message "You do not have permission to view this directory or page".
I see the following in the Web Server logs, but these don't appear to be error messages.
022-06-09 20:08:09 ~1INNOVATION-UNITY-POC-DEV GET /api/logstream/http X-ARR-LOG-ID=bba7b8a4-5d1e-4616-8f43-5237acd8a969 443 - 199.30.194.254 Mozilla/5.0+(Macintosh;+Intel+Mac+OS+X+10_15_7)+AppleWebKit/537.36+(KHTML,+like+Gecko)+Chrome/102.0.5005.61+Safari/537.36 - - innovation-unity-poc-dev.scm.azurewebsites.net 200 0 64 2729 1541 180037
2022-06-09 20:08:20 INNOVATION-UNITY-POC-DEV GET / X-ARR-LOG-ID=628fa657-ed76-4252-a55d-c15b3f4150cf 443 - 199.30.194.254 Mozilla/5.0+(Macintosh;+Intel+Mac+OS+X+10_15_7)+AppleWebKit/537.36+(KHTML,+like+Gecko)+Chrome/102.0.5005.61+Safari/537.36 ARRAffinity=22a7daa836b64a8ce56c907737553d08297ff2e76cd06a1f52c29956b9a85c17;+ARRAffinitySameSite=22a7daa836b64a8ce56c907737553d08297ff2e76cd06a1f52c29956b9a85c17 - innovation-unity-poc-dev.azurewebsites.net 403 14 0 422 1626 62
The only entry I am seeing in the Application Logs is a request to the logstream API.
I have no idea where to look to do any more troubleshooting. Is there some way I can see what the filesystem looks like for the app, to see if my files were deployed correctly?

Flutter packages not recognised in Android Studio

Flutter(1.22.5) packages are not recognized in Android Studio(Windows-10(64bit)),eventhough they are available in the "C:\src\flutter\packages\flutter\lib" directory.
How to resolve this?
Flutter path - C:\src\flutter
DartSdk path - C:\src\flutter\bin\cache\dart-sdk
Packages -
C:\src\flutter>cd "C:\src\flutter\packages\flutter\lib"
C:\src\flutter\packages\flutter\lib>dir
Volume in drive C has no label.
Volume Serial Number is 2EAF-73E1
Directory of C:\src\flutter\packages\flutter\lib
16-Dec-20 04:43 PM <DIR> .
16-Dec-20 04:43 PM <DIR> ..
16-Dec-20 04:43 PM 3,076 analysis_options_user.yaml
16-Dec-20 04:43 PM 9,707 animation.dart
16-Dec-20 04:43 PM 2,024 cupertino.dart
16-Dec-20 04:43 PM 1,777 foundation.dart
16-Dec-20 04:43 PM 1,216 gestures.dart
16-Dec-20 04:43 PM 6,018 material.dart
16-Dec-20 04:43 PM 2,464 painting.dart
16-Dec-20 04:43 PM 677 physics.dart
16-Dec-20 04:43 PM 3,170 rendering.dart
16-Dec-20 04:43 PM 694 scheduler.dart
16-Dec-20 04:43 PM 707 semantics.dart
16-Dec-20 04:43 PM 1,664 services.dart
16-Dec-20 04:43 PM <DIR> src
16-Dec-20 04:43 PM 5,308 widgets.dart
13 File(s) 38,502 bytes
3 Dir(s) 27,227,918,336 bytes free
main.dart -
import 'package:flutter/material.dart';
import 'C:\src\flutter\packages\flutter\lib\material.dart';
ERROR -
Error: Could not resolve the package 'flutter' in 'package:flutter/material.dart'.
^
lib/main.dart:6:8: Error: Not found: 'package:flutter/material.dart'
import 'package:flutter/material.dart';
^
lib/main.dart:7:8: Error: Error when reading 'c:src%0Clutterpackages%0Clutterlibmaterial.dart': StandardFileSystem only supports file:* and data:* URIs
import 'C:\src\flutter\packages\flutter\lib\material.dart';
The original project was created by downloading Flutter via Git ,maybe the latest Flutter version has some bugs.
Downloading Flutter stable version from the official website solved the issue.

Azure functions on Premises - Error response from daemon: Cannot kill container

I am working with Azure Functions on Premises V2 (Runtime).
Trying to test a simple function that is executed each minute and write in logs.
However Function is not executed, and I am getting this error.
It is running on a Virtual Machine with Windows server 2016.
(what I think could be causing this problem).
I am new wiht Docker and Hyper-V, any help will be appreciated.
There are some command lets I can execute, to comprobate if Hyper V and
Docker are running well ?
Thank You in Advance.
This is the Log I'm getting.
3/14/2018 5:42:44 PM Welcome, you are now connected to log-streaming service.3/14/2018 5:41:48 PM [myteslaVM] Function App 'MyContainerFuncApp' is starting...3/14/2018 5:41:49 PM [myteslaVM] Pull container image azfuncrun/azure-functions-runtime:preview2-latest-nanoserver3/14/2018 5:41:50 PM [myteslaVM] preview2-latest-nanoserver: Pulling from azfuncrun/azure-functions-runtime3/14/2018 5:41:50 PM [myteslaVM] Digest: sha256:dfdb47a7638d0cdd1a42c603e3e59311ee0d229222f88329a7c561fc3d8b2ff33/14/2018 5:41:50 PM [myteslaVM] Status: Image is up to date for azfuncrun/azure-functions-runtime:preview2-latest-nanoserver
3/14/2018 5:41:50 PM [myteslaVM] The container image azfuncrun/azure-functions-runtime:preview2-latest-nanoserver has been pulled successfully!
3/14/2018 5:41:50 PM [myteslaVM] Provisioning container MyContainerFuncApp_03/14/2018 5:41:51 PM [myteslaVM] f2788b6c9c5d6115bba891f463759dd0df75c2344e6c217b0280a8b9f686fb32
3/14/2018 5:41:51 PM [myteslaVM] C:\Program Files\Azure Functions Runtime\docker\docker.exe: Error response from daemon: container f2788b6c9c5d6115bba891f463759dd0df75c2344e6c217b0280a8b9f686fb32
encountered an error during CreateContainer: failure in a Windows system call: No hypervisor is present on this system. (0xc0351000) extra info: {"SystemType":"Container","Name":"f2788b6c9c5d6115bba891f463759dd0df75c2344e6c217b0280a8b9f686fb32","Owner":"docker","IgnoreFlushesDuringBoot":true,"LayerFolderPath":"C:\\Program Files\\Azure Functions Runtime\\docker\\windows\\windowsfilter\\f2788b6c9c5d6115bba891f463759dd0df75c2344e6c217b0280a8b9f686fb32","Layers":[{"ID":"951f96e7-ad8c-5e5c-8533-4f70d49a4e6a","Path":"C:\\Program Files\\Azure Functions
"HostName":"f2788b6c9c5d","MappedDirectories":[{"HostPath":"c:\windows\temp\fwas\mycontainerfuncapp","ContainerPath":"c:\home","ReadOnly":false,"BandwidthMaximum":0,"IOPSMaximum":0,"CreateInUtilityVM":false}],"HvPartition":true,"EndpointList":["d6c4c527-5520-40f1-9c84-2f3d8a013900"],"HvRuntime":{"ImagePath":"C:\Program Files\Azure Functions Runtime\docker\windows\windowsfilter\545c1be2ad30f1933a07de48e4ffe611900bacafbf4b717de969b56fb8a725d6\UtilityVM"},"AllowUnqualifiedDNSQuery":true}.
3/14/2018 5:41:51 PM [myteslaVM] Issuing stop command to container: MyContainerFuncApp_
03/14/2018 5:41:52 PM [myteslaVM] Error response from daemon: Cannot kill container: MyContainerFuncApp_0: No such container: MyContainerFuncApp_03/14/2018 5:41:52 PM [myteslaVM] Stop complete for container: MyContainerFuncApp_03/14/2018 5:41:52 PM [myteslaVM] ExecuteCommand called with C:\Program Files\Azure Functions Runtime\docker\docker.exe returned 125.3/14/2018 5:42:03 PM [myteslaVM]
Function App 'MyContainerFuncApp' is starting...3/14/2018 5:42:04 PM [myteslaVM] Pull container image azfuncrun/azure-functions-runtime:preview2-latest-nanoserver3/14/2018 5:42:06 PM [myteslaVM] preview2-latest-nanoserver: Pulling from azfuncrun/azure-functions-runtime3/14/2018 5:42:06 PM [myteslaVM] Digest: sha256:dfdb47a7638d0cdd1a42c603e3e59311ee0d229222f88329a7c561fc3d8b2ff3
3/14/2018 5:42:06 PM [myteslaVM] Status: Image is up to date for azfuncrun/azure-functions-runtime:preview2-latest-nanoserver3/14/2018 5:42:06 PM [myteslaVM] The container image azfuncrun/azure-functions-runtime:preview2-latest-nanoserver has been pulled successfully!3/14/2018 5:42:06 PM [myteslaVM] Provisioning container MyContainerFuncApp_13/14/2018 5:42:07 PM [myteslaVM] 10dfbab15acef64780c34d5d01ded776a10d074500b33ba916b032920404d1d13/14/2018 5:42:07 PM [myteslaVM] C:\Program Files\Azure Functions Runtime\docker\docker.exe:
Researching more on the subject, I realized that it does not work for Basic Plan (SKU) for
virtual Machines.
Only works for SKU in Standard plan.
Applies for both Windows Pro and Windows Server 2016.
After some research I did next steps in order to try to resolve this error.
1.Windows Server 2016 Configuration
https://app.pluralsight.com/player?course=installing-windows-server-2016&author=greg-shields&name=installing-windows-server-2016-m2&clip=5&mode=live
--Install Features and Roles.
2.Install Hyper-V
https://learn.microsoft.com/en-us/windows-server/virtualization/hyper-v/get-started/install-the-hyper-v-role-on-windows-server
To check Hyper-V installed, run this cmd let in Power Shell.
Get-WindowsFeature -ComputerName <computer_name>
Get-WindowsFeature -ComputerName MyteslaVM
To Install Hyper-V
Add-WindowsFeature –name RSAT-Hyper-V-Tools
https://social.technet.microsoft.com/Forums/windows/en-US/f750d5e3-69f8-4cbd-a7aa-98e2fd41c618/need-to-install-hyperv-management-tools-on-server-2012-vm?forum=winserverhyperv
3.Execute Docker version.
4.Execute Dockerd "Daemon" .
https://www.bountysource.com/issues/40602674-can-t-start-docker-service-on-windows-server-vm
dockerd --debug
Stop-service docker
Get-ContainerNetwork | Remove-ContainerNetwork -Force
Start-service docker
5.
Get-VM | Set-VMProcessor -ExposeVirtualizationExtensions $true
https://github.com/Azure/Azure-Functions/issues/359
6.Install Docker
https://learn.microsoft.com/en-us/virtualization/windowscontainers/quick-start/quick-start-windows-server
Install-Module -Name DockerMsftProvider -RequiredVersion 1.0.0.3
Install-Module -Name DockerMsftProvider -Repository PSGallery -Force
Install-Package -Name docker -ProviderName DockerMsftProvider
7.Install The latest azure-functions-core-tools:
npm i -g azure-functions-core-tools#core
Run npm i -g npm **to update
Install .NET Core 2.0
https://www.microsoft.com/net/download/windows
9.To enable nested virtualization, you need to run the following cmdlet in the Hyper-V host:
Get-VM | Set-VMProcessor -ExposeVirtualizationExtensions $true
10.Run Script
https://github.com/moby/moby/issues/19685
11.Download azure-functions-runtime:2.0.0-nanoserver
docker pull microsoft/azure-functions-runtime:2.0.0-nanoserver-1709
12.One of the Hyper-V components is not running
https://social.technet.microsoft.com/Forums/en-US/b4d0761d-6048-4cb8-9a1f-1a2544b4ceb2/one-of-the-hyperv-components-is-not-running?forum=win10itprovirt
13.Disable Windows defender.
https://www.windowscentral.com/how-permanently-disable-windows-defender-windows-10
It seems as Azuer Function runtime component is not working for Windows Server 2016,
because containers.
I tried it with a new Virtual Machine, with Windows 10 Pro. And it is now working.
Steps:
Create Virtual Machine, with Windows 10 Pro
Install/enable Hyper-V
Install and configure Component for Azure Functions.
see image for Azure Function Running

Easyrtc gives socket.io.js file issue for the html of the site

The same question is available on easyrtc forum
https://easyrtc.com/forums/viewthread/167/
I was trying to implement the demo provided here : https://demo.easyrtc.com/demos/demo_audio_video_simple.html
Following steps as given in the below link
https://easyrtc.com/docs/guides/easyrtc_server_install.php
—-
Install Node.js
curl -sL https://deb.nodesource.com/setup | sudo bash -
sudo apt-get install -y nodejs
—-
I am at logged in as root user
root#pbx:/var/www/html#
I did not get any erorr while running above commands
After running the above commands , I went to the second step
——-
2. Create folder hold the EasyRTC application
ex: sudo mkdir /var/nodes
ex: sudo mkdir /var/nodes/easyrtc
—-
I created a folder /var/nodes/easyrtc as given in example
Should I create instead on /var/www/html (where my domain is pointed to)
—-
3. Security Considerations (not going into specifics)
Create user for node.js (or use existing web user)
chown the nodes folder to be owned by this user
ensure the node is run as that user.
—-
Skipping above step since I am already logged in as root.
Please point out how I could verify the three things mentioned above.
———
Download files from the server_example(https://github.com/priologic/easyrtc/tree/master/server_example) folder into your EasyRTC application folder.
OR download and extract this .zip
—-
Does ‘EasyRTC application folder’ mentioned above indicate /var/nodes/easyrtc ?
https://github.com/priologic/easyrtc/tree/master/server_example
root#PBXRecptionist2:/var/nodes/easyrtc# ls
easyrtc-master master.zip package.json README.md server.js static
After downloading the files I get the above in the easyrtc folder
—
Change to the easyrtc folder and then install node modules locally
cd /var/nodes/easyrtc
sudo npm install
—
following the other instructuion
It added node_modules folder with modules as given below
root#PBXRecptionist2:/var/nodes/easyrtc/node_modules# ls
easyrtc express socket.io
—-
Running EasyRTC Server
From Console
Open your console on the server.
In Windows you can use the provided Node.js console program located in the Start Menu.
Navigate to your EasyRTC application folder
Run the server using the node command.
node server.js
—
What does “Open your console on the server.
” mean?
I am logged in via ssh
should I type command “node ” which opens a node console ??
Does “Navigate to your EasyRTC application folder” this mean moving to /var/nodes/easyrtc ?
When I do this “Run the server using the node command.” ,
node.js on /var/nodes/easyrtc
I get the following error
root#PBXRecptionist2:/var/nodes/easyrtc# node server.js
module.js:340
throw err;
^
Error: Cannot find module ‘../’
at Function.Module._resolveFilename (module.js:338:15)
at Function.Module._load (module.js:280:25)
at Module.require (module.js:364:17)
at require (module.js:380:17)
at Object. (/var/nodes/easyrtc/server.js:5:15)
at Module._compile (module.js:456:26)
at Object.Module._extensions..js (module.js:474:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:312:12)
at Function.Module.runMain (module.js:497:10)
and if I do it
root#PBXRecptionist2:/var/nodes/easyrtc# node
node server.js
...
I dont get anything
can anybody point where I am going wrong
Also I get an error that” Your HTML has not included the socket.io.js library”
I am unsure how can I locate the socket.io.js library
My index.html for which I get the above error is
ABCTELECOMMUNICATION: Simple Audio and Video Chat
[removed][removed]
[removed][removed]
[removed][removed]
Not yet connected…
Connected users:
<div id=“otherClients”></div>
</div>
<div id=“videos”>
<video autoplay=“autoplay” class=“easyrtcMirror” id=“selfVideo” muted=“muted” volume=“0” ></video>
<div >
<video autoplay=“autoplay” id=“callerVideo”></video>
</div>
<!—each caller video needs to be in it"s own div so it"s close button can be positioned correctly—>
</div>
</div>
files in the same directory as on the index.html are
drwxr-xr-x 7 root root 4.0K Mar 22 09:14 node_modules
-rw-r—r—1 root root 603 Mar 22 09:08 server.js
-rw-r—r—1 root root 1.2K Mar 22 08:49 index.html
drwxr-xr-x 2 root root 4.0K Mar 22 08:44 easyrtc
-rw-r—r—1 root root 1.2K Mar 21 15:23 index.html~
-rw-r—r—1 root root 170 Mar 20 12:02 socket.io.zip
-rw-r—r—1 root root 1.4K Mar 17 09:50 server.crt
-rw-r—r—1 root root 1.2K Mar 17 09:47 server.csr
-rw-r—r—1 root root 1.7K Mar 17 09:31 server.key
-rw-r—r—1 root root 1.8K Mar 17 09:30 server.key.secure
drwxr-xr-x 2 root root 4.0K Feb 21 10:15 js
drwxr-xr-x 2 root root 4.0K Feb 21 10:00 easyrtc-master
-rw-r—r—1 root root 695K Feb 21 10:00 master.zip
drwxr-xr-x 3 root root 4.0K Aug 24 2015 api
drwxr-xr-x 5 root root 4.0K Aug 24 2015 demos
drwxr-xr-x 3 root root 4.0K Aug 24 2015 dev
drwxr-xr-x 4 root root 4.0K Aug 24 2015 docs
-rw-r—r—1 root root 100 Aug 24 2015 index.js
drwxr-xr-x 2 root root 4.0K Aug 24 2015 lib
-rw-r—r—1 root root 1.4K Aug 24 2015 LICENSE
-rw-r—r—1 root root 932 Aug 24 2015 package.json
-rw-r—r—1 root root 5.7K Aug 24 2015 README.md
drwxr-xr-x 3 root root 4.0K Aug 24 2015 server_example
Can someone help me debug and make the easyrtc work?

Docker volumes on CentOS 7

I have run into a problem on CentOS 7 when attempting to map a volume to the host in a tomcat container. This happens with the public tomcat images as well as an image I have created (based on centos instead of debian).
instantiating a container as follows will succeed:
docker run -it -d tomcat:8
instantiating a container as follows will succeed, but with errors in the log and logs are not written to the host:
docker run -it -d -v /usr/local/tomcat:/usr/local/tomcat tomcat:8
[wpackard#eagle2 tomcat]$ dkr run -it -d -v
/usr/local/tomcat:/usr/local/tomcat tomcat:8
34075701b1436f83a24212170b4d2113ae698df244c449203b1c9af9814485c9
[wpackard#eagle2 tomcat]$ dkr ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
34075701b143 tomcat:8 "catalina.sh run" 5 seconds ago Up 4 seconds 8080/tcp sharp_einstein
[wpackard#eagle2 tomcat]$ dkr logs sharp_einstein
Using CATALINA_BASE: /usr/local/tomcat
Using CATALINA_HOME: /usr/local/tomcat
Using CATALINA_TMPDIR: /usr/local/tomcat/temp
Using JRE_HOME: /usr
Using CLASSPATH: /usr/local/tomcat/bin/bootstrap.jar:/usr/local/tomcat/bin/tomcat-juli.jar
java.util.logging.ErrorManager: 4
java.io.FileNotFoundException: /usr/local/tomcat/logs/catalina.2015-03-31.log (Permission denied)
...
31-Mar-2015 15:32:04.088 SEVERE [Catalina-startStop-1] org.apache.catalina.startup.HostConfig.start Unable to create directory for deployment: /usr/local/tomcat/conf/Catalina/localhost
31-Mar-2015 15:32:04.097 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deploying web application directory /usr/local/tomcat/webapps/ROOT
31-Mar-2015 15:32:04.468 WARNING [localhost-startStop-1] org.apache.catalina.core.StandardContext.postWorkDirectory Failed to create work directory [/usr/local/tomcat/work/Catalina/localhost/ROOT] for context []
31-Mar-2015 15:32:05.966 SEVERE [localhost-startStop-1] org.apache.jasper.EmbeddedServletOptions.<init> The scratchDir you specified: /usr/local/tomcat/work/Catalina/localhost/ROOT is unusable.
31-Mar-2015 15:32:06.042 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deployment of web application directory /usr/local/tomcat/webapps/ROOT has finished in 1,929 ms
31-Mar-2015 15:32:06.043 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deploying web application directory /usr/local/tomcat/webapps/docs
31-Mar-2015 15:32:06.093 WARNING [localhost-startStop-1] org.apache.catalina.core.StandardContext.postWorkDirectory Failed to create work directory [/usr/local/tomcat/work/Catalina/localhost/docs] for context [/docs]
31-Mar-2015 15:32:06.216 SEVERE [localhost-startStop-1] org.apache.jasper.EmbeddedServletOptions.<init> The scratchDir you specified: /usr/local/tomcat/work/Catalina/localhost/docs is unusable.
31-Mar-2015 15:32:06.219 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deployment of web application directory /usr/local/tomcat/webapps/docs has finished in 176 ms
31-Mar-2015 15:32:06.220 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deploying web application directory /usr/local/tomcat/webapps/examples
31-Mar-2015 15:32:06.272 WARNING [localhost-startStop-1] org.apache.catalina.core.StandardContext.postWorkDirectory Failed to create work directory [/usr/local/tomcat/work/Catalina/localhost/examples] for context [/examples]
31-Mar-2015 15:32:07.952 SEVERE [localhost-startStop-1] org.apache.jasper.EmbeddedServletOptions.<init> The scratchDir you specified: /usr/local/tomcat/work/Catalina/localhost/examples is unusable.
[wpackard#eagle2 tomcat]$
Exec'ing to the container and attempting to write also fails.
[wpackard#eagle2 tomcat]$ dkr ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
34075701b143 tomcat:8 "catalina.sh run" 5 minutes ago Up 5 minutes 8080/tcp sharp_einstein
[wpackard#eagle2 tomcat]$ dkr exec -it sharp_einstein /bin/bash
root#34075701b143:/usr/local/tomcat# ls -l
total 96
-rw-rw-r--. 1 root root 56977 Jan 23 11:59 LICENSE
-rw-rw-r--. 1 root root 1397 Jan 23 11:59 NOTICE
-rw-rw-r--. 1 root root 6779 Jan 23 11:59 RELEASE-NOTES
-rw-rw-r--. 1 root root 16204 Jan 23 11:59 RUNNING.txt
drwxrwxr-x. 2 root root 4096 Mar 31 12:14 bin
drwxrwxr-x. 2 root root 4096 Jan 23 11:59 conf
drwxrwxr-x. 2 root root 4096 Mar 31 12:14 lib
drwxrwxr-x. 2 root root 6 Jan 23 11:56 logs
drwxrwxr-x. 2 root root 29 Mar 31 12:14 temp
drwxrwxr-x. 7 root root 76 Jan 23 11:57 webapps
drwxrwxr-x. 2 root root 6 Jan 23 11:56 work
root#34075701b143:/usr/local/tomcat# cd logs
root#34075701b143:/usr/local/tomcat/logs# echo "test" > test.log
bash: test.log: Permission denied
I have created an instance of the postgresql container on centos and that successfully maps and uses the volume, verified by creating a db, stopping the instance and then re-running the container.
[wpackard#eagle2 ~]$ uname --all
Linux eagle2 3.10.0-123.20.1.el7.x86_64 #1 SMP Thu Jan 29 18:05:33 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux
[wpackard#eagle2 ~]$
dkr is an alias to docker, I have created a docker group and added myself to the group to eliminate the need for sudo.
The volume mapping seems to work correctly on ubuntu. On CentOS I have tried both the package version (as below), and also updating it to 1.5.
[wpackard#eagle2 ~]$ dkr --version
Docker version 1.3.2, build 39fa2fa/1.3.2
[wpackard#eagle2 ~]$
How do I make volumes work on CentOS?
I think your volumes are working :-) You have a permission problem. I run into this fairly often with the mapping of user id between the host and the container. On your host, if you look at /usr/local/tomcat (ls -ld), you will see a owner, group and the permissions. You probably have something like 0755 (read/write/exec by owner, read/exec by group, read/exec by world. You can test this theory easily, simple remember the current settings for /usr/local/tomcat/logs, then do:
chmod 777 /usr/local/tomcat/logs
from the docker host (not the container). Then run your test on the container, the Permission denied should evaporate.
This is NOT a good fix, though. I don't know what the community says about user id mapping for docker. One thing you could do is figure out the user and group in your host for that directory. Then, when you create your image (or at run time) create a user with the same id and a group with the same id in the container. Then run your tomcat service using that user in the container.
This is due to SELinux.
You must attach correct type to host directory:
host$ chcon -Rt svirt_sandbox_file_t /usr/local/tomcat

Resources