I have a swagger file both in yaml format and json. I can view the yaml file on swaggers online viewer https://editor.swagger.io/ but when I try to serve the file locally I get the error:
webbrowser: tried to open "http://localhost:40335/docs", no screen found
After using the command:
swagger serve -F=swagger swagger.yaml
To recreate this scenario you can clone this repo: https://github.com/go-swagger/go-swagger/tree/master/fixtures/goparsing/petstore
Then run the following commands (MAC-OS) to generate the yaml file:
Note: you may have to run these commands in the root of the project using sudo -s
Instructions for windows installation can be found here https://goswagger.io/install.html
Download go-swagger
docker pull quay.io/goswagger/swagger
alias swagger="docker run --rm -it --user $(id -u):$(id -g) -e GOPATH=$HOME/go:/go -v $HOME:$HOME -w $(pwd) quay.io/goswagger/swagger"
swagger version to verify installation
Generate swagger Yaml
4.swagger generate spec -o ./swagger.yaml --scan-models
The swagger file should now be generated but for some reason using the command swagger serve -F=swagger swagger.yaml gives the error described above.
Since you are running it inside a docker container and there's no browser in it you are getting the no screen found error.
This can be fixed by passing the --no-open option to swagger serve ....
Also, specify a fixed port by passing the --port option.
Source: https://goswagger.io/usage/serve_ui.html
Related
I want to create a Jenkins slave as a docker. so I use this Github link to create a Ubuntu Jenkins slave.
In this Dockerfile there is a section that use curl to get a jar file.
curl --create-dirs -sSLo /usr/share/jenkins/slave.jar https://repo.jenkins-ci.org/public/org/jenkins-ci/main/remoting/4.0/remoting-4.0.jar
When I want to curl a jar file with curl, didn't work but by any browsers, I could download the jar file.
Why curl bash command doesn't work?
Are you using a proxy in your web browser ?, if so, just:
export http_proxy=http://ip:port
export https_proxy=http://ip:port
I am trying to bring a github repo into my Google Colab workspace via the following code:
!git clone https://github.com/vanvalenlab/deepcell-tf.git
!cd deepcell-tf
!docker build -t $USER/deepcell-tf .
I have followed Google Colab's steps for install Docker (https://colab.research.google.com/drive/10OinT5ZNGtdLLQ9K399jlKgNgidxUbGP).
But when I run the above code, I get the following error:
invalid argument "/deepcell-tf" for "-t, --tag" flag: invalid reference format
See 'docker build --help'.
"-t" is a valid argument to pass according to the documentation. Why does it think I'm passing /deepcell-tf as an argument?
The -t is indeed a valid flag:
--tag , -t Name and optionally a tag in the name:tag format
The problem is that your $USER variable is not set, and your command is being interpreted as docker build -t /deepcell-tf ., which is an invalid form for naming the image.
You need to make sure to export the $USER value before running the docker build, or setting it manually to a valid value. E.g.:
docker build -t my-user/deepcell-tf .
The notebook you linked isn't actually published by Google, it was just made by another user.
Google Colab doesn't support Docker, and they currently have no plans to support it, unfortunately: https://github.com/googlecolab/colabtools/issues/299
I apologize if this a silly question but when I type inside PowerShell of Window 10:
docker run -it -v C:\Users\Bob\Documents\test:/usr/python -w /usr/python
bob/python
It works just fine and I receive the following prompt:
root#63eef6ac2b96:/usr/python#
To avoid repeating the command over and over, I build a makefile that has the following command
docker:
docker run -it -v C:\Users\Bob\Documents\test:/usr/python -w /usr/python bob/python
when I try to execute
make docker
I receive the following error
PS C:\Users\Bob\documents\test> make docker
docker run -it -v C:\Users\Bob\Documents\test:/usr/python -w /usr/python
bob/python
c:\Program Files\Docker\Docker\Resources\bin\docker.exe: Error response from
daemon: the working directory 'C:/MinGW/msys/1.0/python' i
s invalid, it needs to be an absolute path.
See 'c:\Program Files\Docker\Docker\Resources\bin\docker.exe run --help'.
make.exe": *** [docker] Error 125
Any suggestion is greatly appreciated.
You do not have to use a Makefile. Docker compose is what you are looking for.
In brief, you need to create a docker-compose.yml file and inside it describe all the desired steps. I am not aware of your full setup but I will try to provide a skeleton for your docker-compose file.
version: '3.7'(depends on your docker engine version)
services:
python_service(add a name of your choice):
build: build/ (The path of image's Dockerfile)
volumes:
- C:\Users\Bob\Documents\test:/usr/python
working_dir: /usr/python
In the snippet above:
-v flag replaced with volumes section
-w flag replced with working_dir section
How to use:
Now that your docker-compose file is ready, you need to use it. So you do not need to remember/repeat the docker run command, you will simple execute docker-compose up in the directory where your compose file is located and you will have your container up and running.
Note that this is a simple example on how to use docker-compose. It is a powerful feature allowing to start containers from multiple images, creating networks and much more. I would recommend you to read the official documentation for additional information.
We have a separate build for the frontend and backend of the application, where we need to pull the dist build of frontend to backend project during the build. During the build the 'curl' cannot write to the desired location.
In detail, we are using SpringBoot as backend for serving Angular 2 frontend. So we need to pull the frontend files to src/main/resources/static folder.
image: maven:3.3.9
pipelines:
default:
- step:
script:
- curl -s -L -v --user xxx:XXXX https://api.bitbucket.org/2.0/repositories/apprentit/rent-it/downloads/release_latest.tar.gz -o src/main/resources/static/release_latest.tar.gz
- tar -xf -C src/main/resources/static --directory src/main/resources/static release_latest.tar.gz
- mvn package -X
As a result of this the build fails with output of CURL.
* Failed writing body (0 != 16360)
Note: I've tried the same with maven-exec-plugin, the result was the same. The solution works on local machine naturally.
I would try running these commands from a local docker run of the image you're specifying (maven:3.3.9). I found that the most helpful way to debug things that were behaving differently in Pipelines vs. in my local environment.
To your specific question yes, you can download external content from the Pipeline run. I have a Pipeline that clones other repos from BitBucket via HTTP into the running container.
I am currently setting up Parse Cloud Code and I have gotten to the final step which is to deploy the main.js file but when I do this it just opens the file in Adobe Dreamweaver?
I was having problems understanding how to deploy the main.js file.
Read the following steps: https://www.parse.com/apps/quickstart#cloud_code/unix
It contains:
Get the Parse tool
Download the command line tool by running this command:
curl -s https://www.parse.com/downloads/cloud_code/installer.sh | sudo /bin/bash
This installs a tool named parse to /usr/local/bin/parse. That is the only thing that's added, so to uninstall, just delete that file. Running this command will also update your existing Parse command line tool if you already have it installed.
Set up a Cloud Code directory
Open a new terminal window, run the command parse new and follow the instructions.
$ parse new
Please login to Parse using your email and password.
Email: ninja#gmail.com
Password (will be hidden):
Would you like to create a new app, or add Cloud Code to an existing app?
Type "new" or "existing": existing
1:MyApp
2:MyOtherApp
Select an App to add to config: 1
Awesome! Now it's time to setup some Cloud Code for the app: "MyApp",
Next we will create a directory to hold your Cloud Code.
Please enter the name to use for this directory, or hit ENTER to use
"MyApp" as the directory name.
Directory Name: MyCloudCode
Your Cloud Code has been created at ${CLOUD_CODE_DIR}.
Next, you might want to deploy this code with
"parse deploy"
.
This includes a "Hello world" cloud function, so once you deploy
you can test that it works, with:
curl -X POST \
-H "X-Parse-Application-Id: ${APP_ID}" \
-H "X-Parse-REST-API-Key: ${REST_API_KEY}" \
-H "Content-Type: application/json" \
-d '{}' \
https://api.parse.com/1/functions/hello
$ cd MyCloudCode
Go to the directory where your Main.js file does exist and
use command $parse deploy to deploy your code on parse cloud.Refer this link if you are using Linux system.https://www.parse.com/apps/quickstart#cloud_code/unix and use this link if you are using windows system https://parse.com/apps/quickstart#cloud_code/windows.
Hope it will help.
As far as I understand from your question, you want to deploy the main.js file to the Parse cloud. The problem that you face opening in Adobe Dreamweaver is related with your computer where you configure the file open with the Adobe Dreamweaver.
The answer to your question is; as detailed in Parse Cloud tutorial, first you have to install Parse command line tool. This tool enables you to manage your code in Parse cloud. Then you can use "parse new" command to set up a cloud directory where you have to replace the main.js file with your own. Following that "parse deploy" will deploy your js file to the Parse cloud. You can find detailed information in tutorials Parse Cloud. Hope this helps.
Regards.