How can I run 'swagger project edit' on apigee127 Docker-Container? - apigee

I installed apigee-127 in a Docker-Container on my Local machine.
After that I run this Docker-Container and created a project with
a127 project create hello-world
To start this project
a127 project start
The Respone from this is that the Project ist started und u can enter it in your browser with your localhost and the Port thats given or in the same Docker-Container with the curl command
docker: curl http://127.0.0.1:10010/hello?name=Scott
browser: http://localhost:32768/hello?name=Scott
Most a127 commands seem to work fine. Now I would like to use the swagger-editor to edit my project, but there doesn't seem to be an option to edit the project remotely on my Docker-Container without an browser.
a127 project edit
The Answer is:
Starting Swagger editor.
Opening browser to: http://localhost:36070/#/edit
{ [Error: Command failed: xdg-open: no method available for opening 'http://localhost:36070/#/edit'
] killed: false, code: 3, signal: null }
My first issue is that i have no chance to start a browser inside my Docker-Container -> its a webserver without GUI or Browser.
I wanted to start my swagger-editor outside the Container on my local machine but I had no idea to get into it.
Maybe someone can help me to get done with this problem?

I'm not using a127, but swagger project edit --help command output this.
-s do not open the browser
# swagger project edit --help
Usage: edit [options] [directory]
open Swagger editor for this project or the specified project directory
Options:
-h, --help output usage information
-s, --silent do not open the browser
--host the hostname the editor is served from
-p, --port the port the editor is served from

Related

Unable to install IIS AspNetCoreModuleV2 in a dockerimage (and Azure Pipelines)

I have a problem for few days now with the "dotnet hosting bundle" and AspNetCoreV2 IIS module in a dockerimage.
So, I creating a dockerimage with many IIS modules and requirements to execute our software. The dockerimage works good expect this AspNetCoreV2 module. When the container created, I check the modules installed with Get-WebGlobalModule and doesn't appear.
But, when I start the quiet (or passive) installation manualy, into the container, this module works and appear in the IIS Module list.
I tried many solutions to do that (multistage with aspnetcore Microsoft images, last version of dotnet_hosting_bundle.exe and many other, but same issue).
I tried to automatise the docker exec process to install this module manualy and commit it with Azure Pipelines and Windows agent in a VM, but doesn't work :(.
To try that, I use different way :
docker stop mycontainer
docker rm mycontainer
docker run --name mycontainer -d -it $(containerRegistry)/$(container_requirement_name):v1.0.$(Build.BuildId)
docker exec mycontainer powershell.exe -command Start-Process -FilePath 'C:\Program Files\MySoftware\PowerShell\Installer.Prerequisites\dotnet-hosting-3.1.2-win.exe' -ArgumentList "/passive","/install","/norestart" -PassThru -Wait
docker stop mycontainer
docker commit mycontainer $(containerRegistry)/$(container_requirement_name):v1.0.$(Build.BuildId).1
In the Start-Process, I can see :
The process is created but apparently not started
I also tried with : cmd 'C:\Program Files\MySoftware\PowerShell\Installer.Prerequisites\dotnet-hosting-3.1.2-win.exe' /quiet /install
This task in Azure Pipeline working without error, but when I download this new image (pushed after these instructions), the module doesn't appear in Get-WebGlobalModule
Also, the module is not presend into ProgramFiles
I don't really understand how can I install this module. All other modules working, expect this ...
Thanks you very much in advance for your advises.
Best
Set the preference variables with below command fixed above issue.
powershell -Command $ErrorActionPreference = 'Stop' $ProgressPreference = 'Continue'
The values of the preference variables affect how PowerShell operates and executes cmdLets. It might be because the default settings of the preference variables of the container that caused the PowerShell failing to complete the installation. You can override these preference variables in your script.
Please see this document for more information about Preference Variables.

Symfony2 custom console command appears as “not defined” upon execution

Please help, I've tried everything;
The command works well on the development server, but not on live.
Before you mark it as duplicate:
The filename ends with Command.php
The Bundle is registered
The command is ContainerAware
The command is in the Bundle\Command directory and in the App\Bundle\Command namespace
I have tried:
clearing and warming up the cache on the server multiple times using the symfony console php console --env=preprod cache:clear and php console --env=preprod cache:warmup
listing available commands by calling the console without extra arguments php console --env=preprod
Is there any other way to force symfony to re-check available commands ?
For future reference:
The problem was that I connected to the remote host before deploy, and bash doesn't update symlink targets.
So the Command was not available in my current working directory.
A simple cd .., cd current solved it.

docker cannot run in visual studio

error during connect: Get http://%2F%2F.%2Fpipe%2Fdocker_engine/v1.26/containers/json: open //./pipe/docker_engine: The system cannot find the file specified. In the default daemon configuration on Windows, the docker client must be run elevated to connect. This error may also indicate that the docker ...
Try running Visual Studio as admin. Also check if your daemon is running and ready. If you are using docker for windows, and not only the binaries, then there should be a docker icon on the task bar. Also try to give more context in your question, exactly when did this happen?

How do you run lite-server as a Windows service?

I am trying to set up lite-server as a Windows service so that it starts automatically when the machine starts. I am trying to do this via NSSM.
I install as follows:
nssm install <servicename> lite-server
Then, since I see it complaining in the event viewer about the directory it's running from, I add this:
nssm set <servicename> AppDirectory <serviceDirectory>
If I run lite-server directly from the command line it works.
However, if I start the Windows service installed as above, it fails, and in the event viewer I get:
Failed to start service . Program lite-server couldn't be launched. CreateProcess() failed: The system cannot find the file specified.
I have tried:
Adding the path to %APPDATA%\npm to the system path to make sure lite-server can be found.
Installing the service under my own username.
It didn't work. What do I need to do to run lite-server as a Windows service?
please try with same config
path: C:\Users\{username}\AppData\Roaming\npm\lite-server.cmd
startup directory : bs-config.json config file path
screenshot like this

How to deploy asp.net application to docker container on Linux server?

I have installed docker engine on a Linux server. On my desktop's Visual Studio 2015, I created an asp.net application. Now I want to publish it to the Linux server and create a docker image.
I followed this step.
I don't have an azure account and I want to use my own Linux server. So next, I clicked the Docker Containers. The interface became:
Then I clicked Custom Docker Host and pressed OK button.
The interface was
Now I input the image name as DockerDemo. Also I type the server url something like tcp://12.16.45.56:8080. Validate connection is okay then go to the next step.
Finally I get this:
However I get an error during publish.
Severity Code Description Project File Line Suppression State
Error An error occured during publish.
The command [docker -H tcp://12.16.45.56:8080 build -t DockerDemo -f "C:\Users\me\AppData\Local\Temp\PublishTemp\DockerDemo63\approot\src\DockerDemo\Dockerfile" "C:\Users\me\AppData\Local\Temp\PublishTemp\DockerDemo63"] exited with code 1: 'docker' is not recognized as an internal or external command,
operable program or batch file.
Please visit http://go.microsoft.com/fwlink/?LinkID=529706 for troubleshooting guide. DockerDemo 0
By the way, the framework I am using is:
"frameworks": {
"dnx451": { },
"dnxcore50": { }
}
Thanks for help!
Visual Studio can't find the docker command on your local computer. It needs this as a client to connect to the docker daemon on your Linux server. The easiest way to do this is to install Docker Toolbox from here:
https://www.docker.com/products/docker-toolbox
You may have to uninstall and re-install "Visual Studio 2015 Tools for Docker" or manually add to Powershell's $env:Path if the docker command still can't be found.
Also, your Image Name must not contain uppercase characters. Use dockerdemo rather than DockerDemo.

Resources