This Repo will be used to demonstrate the Skills & Questions in DevOps
Please post your questions also to here
This Repo will be used to demonstrate the Skills & Questions in DevOps
License: Apache License 2.0
Please let me know why it's coming in yours as well as mine jenkins console.
I tried to figure it out with the help of this link but still facing the same issue in my local jenkins.
https://wiki.jenkins.io/display/JENKINS/Running+Jenkins+behind+Apache
Hai ,
I have low configuration on my system so, i am planning to install jenkins on ec2 for that please let me know how to see proper billing cost for instance types on ec2 and which instance type should i choose to complete the assignments on jenkins.
Hi Sir,
i am getting below error while starting the service in artifactory server. Please hep me to fix this issue.
root@ip-172-31-16-195:/home/ubuntu# systemctl status artifactory.service
● artifactory.service - Setup Systemd script for Artifactory in Tomcat Servlet Engine
Loaded: loaded (/lib/systemd/system/artifactory.service; enabled; vendor preset: enabled)
Active: activating (auto-restart) (Result: resources) since Thu 2018-05-31 03:15:42 UTC; 2s ago
Process: 4901 ExecStart=/opt/jfrog/artifactory/bin/artifactoryManage.sh start (code=exited, status=0/SUCCESS)
May 31 03:15:42 ip-172-31-16-195 systemd[1]: artifactory.service: PID file /var/opt/jfrog/run/artifactory.pid not readable (yet?) after start: No such file or directory
May 31 03:15:42 ip-172-31-16-195 systemd[1]: Failed to start Setup Systemd script for Artifactory in Tomcat Servlet Engine.
May 31 03:15:42 ip-172-31-16-195 systemd[1]: artifactory.service: Unit entered failed state.
May 31 03:15:42 ip-172-31-16-195 systemd[1]: artifactory.service: Failed with result 'resources'.
root@ip-172-31-16-195:/home/ubuntu#
This is my json file and i have started my powershell with admin permissions and just am trying to validate the json but am getting following error:
command :packer validate .\nginx.json
Error : Failed to initialize build 'amazon-ebs': error initializing builder 'amazon-ebs': Unrecognized remote plugin message: Error starting plugin server: Couldn't bind plugin TCP listener
{
"builders": [
{
"type": "amazon-ebs",
"access_key": "access-id",
"secret_key": "pwd",
"region": "us-east-1",
"source_ami": "ami-a4dc46db",
"instance_type": "t2.micro",
"ssh_username": "ubuntu",
"ami_name": "packer-nginx"
}
]
}
]
}
After installation of jFrog am unable to start service. Below is the logs.
root@ip-172-31-1-174:~# systemctl status artifactory.service
● artifactory.service - Setup Systemd script for Artifactory in Tomcat Servlet Engine
Loaded: loaded (/lib/systemd/system/artifactory.service; enabled; vendor preset: enabled)
Active: activating (auto-restart) (Result: exit-code) since Wed 2018-05-30 15:47:41 UTC; 4s ago
Process: 7459 ExecStart=/opt/jfrog/artifactory/bin/artifactoryManage.sh start (code=exited, status=1/FAILURE)
May 30 15:47:41 ip-172-31-1-174 systemd[1]: Failed to start Setup Systemd script for Artifactory in Tomcat Servlet Engine.
May 30 15:47:41 ip-172-31-1-174 systemd[1]: artifactory.service: Unit entered failed state.
May 30 15:47:41 ip-172-31-1-174 systemd[1]: artifactory.service: Failed with result 'exit-code'.
root@ip-172-31-1-174:~#
Any configuration am missing ? Please help!
hai guys,
i am trying to install ubuntu 14.04 with vagrant, i am getting below error.
vagrant up
The version of powershell currently installed on this host is less than
the required minimum version. Please upgrade the installed version of
powershell to the minimum required version and run the command again.
Installed version: N/A
Minimum required version: 3
how to get the game-of-life.war file.
for practicing while installing tomcat7 on ubuntu server
i am starting for docker class
Hai,
As per the documentation i have been installed jenkins but while building the game of life my build was failure and it was shown env variables are not defined correctly.
But i have done it exactly whatever in the documentation any help would be highly appreciated.
Find the screen shot of my error in the below attachment.
==> azure-arm: Running builder ...
azure-arm: Creating Azure Resource Manager (ARM) client ...
azure-arm: temp admin user: 'packer'
azure-arm: temp admin password: 'KwvlZseFM0L10dcgsXlY05jjSKC36rSh'
==> azure-arm: Creating resource group ...
==> azure-arm: -> ResourceGroupName : 'packer-Resource-Group-9dkkdz441m'
==> azure-arm: -> Location : 'East US'
==> azure-arm: -> Tags :
==> azure-arm: ->> dept : Engineering
==> azure-arm: ->> task : Image deployment
==> azure-arm: Pausing after run of step 'StepCreateResourceGroup'. Press enter to continue.
==> azure-arm: Validating deployment template ...
==> azure-arm: -> ResourceGroupName : 'packer-Resource-Group-9dkkdz441m'
==> azure-arm: -> DeploymentName : 'pkrdp9dkkdz441m'
==> azure-arm: Pausing after run of step 'StepValidateTemplate'. Press enter to continue.
==> azure-arm: Deploying deployment template ...
==> azure-arm: -> ResourceGroupName : 'packer-Resource-Group-9dkkdz441m'
==> azure-arm: -> DeploymentName : 'pkrdp9dkkdz441m'
==> azure-arm: resources.DeploymentsClient#CreateOrUpdate: Failure sending request: StatusCode=200 -- Original Error: Lo
ng running operation terminated with status 'Failed': Code="DeploymentFailed" Message="At least one resource deployment
operation failed. Please list deployment operations for details. Please see https://aka.ms/arm-debug for usage details."
==> azure-arm: Pausing before cleanup of step 'StepValidateTemplate'. Press enter to continue.
==> azure-arm: Pausing before cleanup of step 'StepCreateResourceGroup'. Press enter to continue.
==> azure-arm:
==> azure-arm: Cleanup requested, deleting resource group ...
==> azure-arm: Resource group has been deleted.
Build 'azure-arm' errored: resources.DeploymentsClient#CreateOrUpdate: Failure sending request: StatusCode=200 -- Origin
al Error: Long running operation terminated with status 'Failed': Code="DeploymentFailed" Message="At least one resource deployment operation failed. Please list deployment operations for details. Please see https://aka.ms/arm-debug for usa
ge details."
==> Some builds didn't complete successfully and had errors:
--> azure-arm: resources.DeploymentsClient#CreateOrUpdate: Failure sending request: StatusCode=200 -- Original Error: Long running operation terminated with status 'Failed': Code="DeploymentFailed" Message="At least one resource deployment
operation failed. Please list deployment operations for details. Please see https://aka.ms/arm-debug for usage details."
==> Builds finished but no artifacts were created.
While provisioning the VM in Azure, I have keep getting the following error with windows.
here it my main.tf configuration
provider "azurerm" {
subscription_id = "${var.AZURE_SUBSCRIPTION_ID}"
client_id = "${var.AZURE_CLIENT_ID}"
client_secret = "${var.AZURE_CLIENT_SECRET}"
tenant_id = "${var.AZURE_TENANT_ID}"
}
resource "azurerm_resource_group" "res_group" {
name = "terraformresourcegroup"
location = "eastus"
}
resource "azurerm_storage_account" "storage_acc" {
name = "mystorageaccount20180"
resource_group_name = "${azurerm_resource_group.res_group.name}"
location = "${azurerm_resource_group.res_group.location}"
account_tier = "Standard"
account_replication_type = "LRS"
tags {
environment = "Storage-Acount-Test"
}
}
resource "azurerm_virtual_network" "my_virt_net" {
name = "production-network"
address_space = ["10.0.0.0/16"]
resource_group_name = "${azurerm_resource_group.res_group.name}"
location = "${azurerm_resource_group.res_group.location}"
}
#create subnets
resource "azurerm_subnet" "test1" {
name = "subnet1"
resource_group_name = "${azurerm_resource_group.res_group.name}"
virtual_network_name = "prod1"
address_prefix = "10.0.5.0/24"
}
#Create Public IP
resource "azurerm_public_ip" "datasourceip" {
name = "testPublicIp"
location = "${azurerm_resource_group.res_group.location}"
resource_group_name = "${azurerm_resource_group.res_group.name}"
public_ip_address_allocation = "Dynamic"
}
resource "azurerm_subnet" "test2" {
name = "subnet2"
resource_group_name = "${azurerm_resource_group.res_group.name}"
virtual_network_name = "prod2"
address_prefix = "10.0.6.0/24"
}
resource "azurerm_subnet" "test3" {
name = "subnet3"
resource_group_name = "${azurerm_resource_group.res_group.name}"
virtual_network_name = "prod3"
#virtual_network_name = "${azurerm_virtual_network.my_virt_net.name}"
address_prefix = "10.0.7.0/24"
}
#Create network interface
resource "azurerm_network_interface" "my_int" {
name = "myWindowsServer_NIC"
location = "${azurerm_resource_group.res_group.location}"
resource_group_name = "${azurerm_resource_group.res_group.name}"
#network_security_group_id = "${var.vm_security_group_id}"
ip_configuration {
name = "Server2016"
subnet_id = "${azurerm_subnet.test1.id}"
private_ip_address_allocation = "dynamic"
public_ip_address_id = "${azurerm_public_ip.datasourceip.id}"
}
}
resource "azurerm_managed_disk" "test" {
name = "datadisk_existing"
location = "${azurerm_resource_group.res_group.location}"
resource_group_name = "${azurerm_resource_group.res_group.name}"
storage_account_type = "Standard_LRS"
create_option = "Empty"
disk_size_gb = "1023"
}
resource "azurerm_virtual_machine" "test" {
name = "myvm"
location = "${azurerm_resource_group.res_group.location}"
resource_group_name = "${azurerm_resource_group.res_group.name}"
network_interface_ids = ["${azurerm_network_interface.my_int.id}"]
vm_size = "Standard_DS1_v2"
delete_os_disk_on_termination = "true"
delete_data_disks_on_termination = "true"
storage_image_reference {
publisher = "${var.vm_image_publisher}"
offer = "${var.vm_image_offer}"
sku = "${var.vm_image_sku}"
version = "${var.vm_image_version}"
}
storage_os_disk {
name = "datadisk_new_2018_01"
caching = "ReadWrite"
create_option = "FromImage"
managed_disk_type = "Standard_LRS"
}
storage_data_disk {
name = "datadisk_new"
managed_disk_type = "Standard_LRS"
create_option = "Empty"
lun = 0
disk_size_gb = "1023"
}
#Additional disk 2
storage_data_disk {
name = "${azurerm_managed_disk.test.name}"
managed_disk_id = "${azurerm_managed_disk.test.id}"
create_option = "Attach"
lun = 1
disk_size_gb = "${azurerm_managed_disk.test.disk_size_gb}"
}
#define credentials
os_profile {
computer_name = "SERVER2016"
admin_username = "${var.VM_ADMIN}"
admin_password = "${var.VM_PASSWORD}"
}
os_profile_windows_config {
provision_vm_agent = "true"
enable_automatic_upgrades = "true"
winrm {
protocol = "http"
certificate_url = ""
}
}
}
#get public IP
data "azurerm_public_ip" "test" {
name = "${azurerm_public_ip.datasourceip.name}"
resource_group_name = "${azurerm_resource_group.res_group.name}"
depends_on = ["azurerm_virtual_machine.test"]
}
output "ip_address" {
value = "${data.azurerm_public_ip.test.ip_address}"
}
Thanks,
Hari
After Installing jfrog Not able to brning up service on Ubuntu machine getting below issue.
I am able to check the artifactory .
root@ip-172-31-3-232:/home/ubuntu/artifactory-oss-6.0.1/bin# ./artifactoryctl check
Checking arguments to Artifactory:
ARTIFACTORY_HOME = /home/ubuntu/artifactory-oss-6.0.1
ARTIFACTORY_USER = artifactory
TOMCAT_HOME = /home/ubuntu/artifactory-oss-6.0.1/tomcat
ARTIFACTORY_PID = /home/ubuntu/artifactory-oss-6.0.1/run/artifactory.pid
JAVA_HOME = /usr/lib/jvm/java-8-oracle/
JAVA_OPTIONS = -server -Xms512m -Xmx2g -Xss256k -XX:+UseG1GC -XX:OnOutOfMemoryError="kill -9 %p" -Djruby.compile.invokedynamic=false -Dfile.encoding=UTF8 -Dartdist=zip -Dorg.apache.tomcat.util.buf.UDecoder.ALLOW_ENCODED_SLASH=true -Djava.security.egd=file:/dev/./urandom
root@ip-172-31-3-232:/home/ubuntu/artifactory-oss-6.0.1/bin# ./artifactoryctl start
found java executable in JAVA_HOME
Starting Artifactory tomcat as user artifactory...
/home/ubuntu/artifactory-oss-6.0.1/tomcat/bin/startup.sh: 1: /home/ubuntu/artifactory-oss-6.0.1/tomcat/bin/startup.sh: uname: not found
/home/ubuntu/artifactory-oss-6.0.1/tomcat/bin/startup.sh: 1: /home/ubuntu/artifactory-oss-6.0.1/tomcat/bin/startup.sh: dirname: not found
Cannot find /catalina.sh
The file is absent or does not have execute permission
This file is needed to run this program
** ERROR: Artifactory Tomcat server did not start. Please check the logs
But logs have not generated in tomcat logs folder
Hi All,
My aim is to create a user (test1), write a policy where in, the test1 user can only view selected instances(based on Tag (key-value) in a particular region (ap-south-1, MUMBAI). I tried with below policies which did not work.
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": "ec2:Describe*",
"Resource": "*",
"Condition": {
"StringEquals": {
"ec2:ResourceTag/": "prod" <== This will filter based on Value=prod instance.
}
}
}
]
}
ubuntu@ip-172-31-35-30:~$ wget http://ftp.wayne.edu/apache/maven/maven-3/3.5.2/binaries/apache-maven-3.5.2-bin.zip
--2018-06-06 06:32:34-- http://ftp.wayne.edu/apache/maven/maven-3/3.5.2/binaries/apache-maven-3.5.2-bin.zip
Resolving ftp.wayne.edu (ftp.wayne.edu)... 141.217.0.199
Connecting to ftp.wayne.edu (ftp.wayne.edu)|141.217.0.199|:80... connected.
HTTP request sent, awaiting response... 404 Not Found
2018-06-06 06:32:34 ERROR 404: Not Found.
I have been trying to wget maven and seems like file not found on the server and unable to find the correct link to download maven. Could you please help me in getting the correct link.
Thanks,
Raj
INFO: ------------------------------------------------------------------------
INFO: EXECUTION FAILURE
INFO: ------------------------------------------------------------------------
INFO: Total time: 16.501s
INFO: Final Memory: 11M/121M
INFO: ------------------------------------------------------------------------
ERROR: Error during SonarQube Scanner execution
ERROR: Please provide compiled classes of your project with sonar.java.binaries property
ERROR:
ERROR: Re-run SonarQube Scanner using the -X switch to enable full debug logging.
WARN: Unable to locate 'report-task.txt' in the workspace. Did the SonarScanner succedeed?
ERROR: SonarQube scanner exited with non-zero code: 1
Finished: FAILURE
hello sir..
from where i will find the list of use case file .....which you are given end of the jenkins class..
I have couple of queries in AWS Auto Scaling.
(a) Suppose I deleted or terminated one instance, the minimum instances defined in Launch Configuration is 2, hence automatically a new instance should be created since the minimum instances is 2. But when I tried, it does not create a new instance.
(b) Due to auto scaling conditions (CPU > 60%) a new instance was created this week and suppose next week the instance gets terminated due to scale down condition (CPU < 10) met. So, now while termination of instance automatically, what happens to data??
(c) I have created a Launch Configuration, and applied Auto scaling with min 2 instances. I haven't installed any app or service. So the CPU remains less than 5% always. But the instances does not gets decremented or terminated even though it meets Scale Down condition (CPU < 10%). So, my question in any case, the minimum instances (2 in this case) will not be disturbed or destroyed. Is that true?
Thanks for providing this communication facility, it will be very help full for us to discuses and know about all devops&Aws issues .
I created a nodeport service and exposed the port 30036 using nodePort statement. I was able to get the nginx welcome page using the private ip of ec2 instance from both Master and Node but when I curl the pod's Ip, I got connection refused. Can any one tell me the reason behind it? cant we expose the pods IP?
ubuntu@ip-172-31-17-243:~$
kubectl get pods -o wide`
NAME READY STATUS RESTARTS AGE IP NODE
my-replication-controller-7mj65 1/1 Running 0 1h 10.44.0.1 ip-172-31-29-38
my-replication-controller-gc96t 1/1 Running 0 1h 10.44.0.2 ip-172-31-29-38
my-replication-controller-sg64p 1/1 Running 0 1h 10.44.0.3 ip-172-31-29-38
my-test-node-port 1/1 Running 0 36m 10.44.0.4 ip-172-31-29-38
ubuntu@ip-172-31-17-243:~$ curl 172.31.29.38:30036
ubuntu@ip-172-31-17-243:~$ curl 10.44.0.4:30036
curl: (7) Failed to connect to 10.44.0.4 port 30036: Connection refused
Hi Team,
I installed Jenkins and Nginx on Centos 7 machine but i checked few proxy pass settings they mentioned that you have to change the servername with your local domain name, now i am confused with server IP and servername configuration. Please suggest how to get jenkins domain name.
_____My proxy pass setting in nginx
**upstream jenkins{
server 10.0.2.15:8081;
}
server{
listen 80;
server_name ci.yourdomain.com;
access_log /var/log/nginx/jenkins.access.log;
error_log /var/log/nginx/jenkins.error.log;
proxy_buffers 16 64k;
proxy_buffer_size 128k;
location / {
proxy_pass http://jenkins;
proxy_next_upstream error timeout invalid_header http_500 http_502 http_503 http_504;
proxy_redirect off;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto https;
}
}**
I've installed Jenkins 2.127 version in my Windows 7 64 bit Operating system. When I try to create a free style project , I'm copying a github url and pasting in source code management section. But the following error is coming.
The following is the console output.
I've Git and Maven installed in my system.
Thank you.
I added plugin "Login with google plugin" post that login stop working and facing the below error:
Error: invalid_request
device_id and device_name are required for private IP: http://<private_ip>:8080/securityRealm/finishLogin
Can you please provide a resolution.
The logs are
errors.zip
I am not using any variable file to define the variables , I am trying to define in the same program/code
provider "aws" {
access_key = "xxxx"
secret_key = "xxxx"
region = "us-west-2c"
}
module "ec2-inst" {
source = "terraform-aws-modules/ec2-instance/aws"
name = "ec2-inst"
instance_count = 1
ami = "ami-db710fa3"
instance_type = "t2.micro"
key_name = "tf_keypair"
vpc_security_group_ids = ["sg-06cdc7b5f9ccaee35"]
subnet_id = "subnet-34385f6e"
tags = {
Terraform = "true"
Environment = "dev"
}
}
Error: resource 'aws_instance.terraform_inst' config: unknown variable reference d: 'imageid'; define it with a 'variable' block
Error: resource 'aws_instance.terraform_inst' config: unknown variable reference d: 'instancetype'; define it with a 'variable' block
Error: resource 'aws_instance.terraform_inst' config: unknown variable reference d: 'keypair'; define it with a 'variable' block
Error: provider config 'aws': unknown variable referenced: 'region'; define it w ith a 'variable' block
Error: provider config 'aws': unknown variable referenced: 'accesskey'; define i t with a 'variable' block
I was trying to create a jenkins delivery pipeline where one job will build gameoflife war file, second job will copy the war file to another jenkins slave where docker is installed and third job will build the docker image and push to docker hub. 3 jobs are parametrized and pass output to downstream job. First and second job was successful however third job is failing with the following error in the screenshot.
I have already added jenkins user to docker group and was able to manually execute the docker commands as jenkins user. Please see the details,
jenkins@ip-172-31-23-111:~/workspace/build-container-gol$ docker build -t sanjaymv/gameoflife:1.0 .
Sending build context to Docker daemon 83.7MB
Step 1/5 : FROM tomcat:8.0
---> b4b762737ed4
Step 2/5 : LABEL author="sanjaymv" organization="my-org"
---> Using cache
---> 9ca59ffb9541
Step 3/5 : COPY gameoflife.war /usr/local/tomcat/webapps/gameoflife.war
---> bbcce8ec02ab
Step 4/5 : EXPOSE 8080
---> Running in fc2cf2c7604f
Removing intermediate container fc2cf2c7604f
---> 7a5fa6e67386
Step 5/5 : CMD ["catalina.sh", "run"]
---> Running in ad1f6e0e4a84
Removing intermediate container ad1f6e0e4a84
---> 86ce877708e1
Successfully built 86ce877708e1
Successfully tagged sanjaymv/gameoflife:1.0
Please help me to solve the issue or suggest me an alternate way to accomplish the task
iam facing this below issue
Started by upstream project "gameoflife" build number 4
originally caused by:
Started by user durga manikanta punnam
Building in workspace /var/lib/jenkins/workspace/cdex
[cdex] $ /bin/sh -xe /tmp/jenkins8983592963623440870.sh
“echo Location is /var/lib/jenkins/workspace/gameoflife/gameoflife-web/target/gameoflife.war
/tmp/jenkins8983592963623440870.sh: 2: /tmp/jenkins8983592963623440870.sh: “echo: not found
Build step 'Execute shell' marked build as failure
Finished: FAILURE
"can u help me"
Hi
Iv Launched the Kubernertes service in azure. the service was deployed iv connected with the Powershell (linux) from the Portal and running the commands, Getting an error server rejected our request
Iam i missing to run any credentials command? iv cloned the GITHUB repository and runned the command
How to link Jenkins and Maven Containers in Docker ?
command that is working
docker.zip
Hi All
First of all it is a lengthy one since i tried to give my whole process. Please have patience in going through them. :)
I was trying to dockerize a nodejs app from a base image of nodejs:10. The issue is that, after running the app the container gets killed. I was using my own network and allocating ip of my desired. It was working and not getting killed when i manually run the whole statements in my Dockerfile.
Please see what i done manually and building docker image
ubuntu@ip-172-31-23-111:~/my-images$ docker run -it -v /home/ubuntu/node_vol/:/opt --name node_test4321 --network new_bridge --ip 192.168.0.10 node:10
ubuntu@ip-172-31-23-111:~/my-images$ docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
22c3fcea0b77 node:10 "node" 8 seconds ago Up 8 seconds node_test4321
0b3090108e0f node:10 "node" 11 minutes ago Up 11 minutes 0.0.0.0:804->8080/tcp node_vsdfdf
ec0be281e25c node:10 "node" 13 minutes ago Up 13 minutes 0.0.0.0:88->8080/tcp friendly_rosalind
970ef4c77e85 node:10 "/bin/bash" 14 minutes ago Up 14 minutes 0.0.0.0:808->8080/tcp xenodochial_davinci
bc7690c38225 node:10 "/bin/bash" 15 minutes ago Up 15 minutes 0.0.0.0:80->8080/tcp elated_cray
ubuntu@ip-172-31-23-111:~/my-images$ docker exec -it 22c3fcea0b77 /bin/bash
root@22c3fcea0b77:/# cat opt/src/app/hello.js
var http = require('http');
http.createServer(function (req, res) {
res.writeHead(200, {'Content-Type': 'text/plain'});
res.end('Hello World\n');
}).listen(8080, '192.168.0.10');
console.log('Server running at http://192.168.0.10:8080/');
root@22c3fcea0b77:/# cd opt/src/app/
root@22c3fcea0b77:/opt/src/app# node hello.js
Server running at http://192.168.0.10:8080/
^C
root@22c3fcea0b77:/opt/src/app# npm install pm2 -g
/usr/local/bin/pm2 -> /usr/local/lib/node_modules/pm2/bin/pm2
/usr/local/bin/pm2-dev -> /usr/local/lib/node_modules/pm2/bin/pm2-dev
/usr/local/bin/pm2-runtime -> /usr/local/lib/node_modules/pm2/bin/pm2-runtime
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected]
root@22c3fcea0b77:/opt/src/app# pm2 start hello.js
[PM2] Spawning PM2 daemon with pm2_home=/root/.pm2
[PM2] PM2 Successfully daemonized
[PM2] Starting /opt/src/app/hello.js in fork_mode (1 instance)
[PM2] Done.
┌──────────┬────┬──────┬─────┬────────┬─────────┬────────┬─────┬───────────┬──────┬──────────┐
│ App name │ id │ mode │ pid │ status │ restart │ uptime │ cpu │ mem │ user │ watching │
├──────────┼────┼──────┼─────┼────────┼─────────┼────────┼─────┼───────────┼──────┼──────────┤
│ hello │ 0 │ fork │ 63 │ online │ 0 │ 0s │ 0% │ 23.0 MB │ root │ disabled │
└──────────┴────┴──────┴─────┴────────┴─────────┴────────┴─────┴───────────┴──────┴──────────┘
Use pm2 show <id|name>
to get more details about an app
root@22c3fcea0b77:/opt/src/app# curl 192.168.0.10:8080
Hello World
root@22c3fcea0b77:/opt/src/app# read escape sequence
ubuntu@ip-172-31-23-111:~/my-images$ docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
22c3fcea0b77 node:10 "node" 11 minutes ago Up 11 minutes node_test4321
ubuntu@ip-172-31-23-111:~/my-images$ docker build -t my_nodejs_app:10.0 .
Sending build context to Docker daemon 3.072kB
Step 1/9 : FROM node:10
---> 8753edeb1aa3
Step 2/9 : MAINTAINER sanjaymv
---> Using cache
---> 30db4cc14612
Step 3/9 : RUN mkdir -p /src/app
---> Using cache
---> 336d605f54d8
Step 4/9 : WORKDIR /src/app
---> Using cache
---> f969f113c8d4
Step 5/9 : ADD hello.js /src/app/hello.js
---> 989b384cafce
Step 6/9 : EXPOSE 8080
---> Running in ade2d6715a37
Removing intermediate container ade2d6715a37
---> 2e0622d8baaf
Step 7/9 : RUN apt-get update && npm install pm2 -g
---> Running in a4ca19ba60f0
Get:1 http://security.debian.org jessie/updates InRelease [94.4 kB]
Get:2 http://security.debian.org jessie/updates/main amd64 Packages [624 kB]
Ign http://deb.debian.org jessie InRelease
Get:3 http://deb.debian.org jessie-updates InRelease [145 kB]
Get:4 http://deb.debian.org jessie Release.gpg [2420 B]
Get:5 http://deb.debian.org jessie-updates/main amd64 Packages [23.0 kB]
Get:6 http://deb.debian.org jessie Release [148 kB]
Get:7 http://deb.debian.org jessie/main amd64 Packages [9098 kB]
Fetched 10.1 MB in 6s (1498 kB/s)
Reading package lists...
/usr/local/bin/pm2 -> /usr/local/lib/node_modules/pm2/bin/pm2
/usr/local/bin/pm2-dev -> /usr/local/lib/node_modules/pm2/bin/pm2-dev
/usr/local/bin/pm2-docker -> /usr/local/lib/node_modules/pm2/bin/pm2-docker
/usr/local/bin/pm2-runtime -> /usr/local/lib/node_modules/pm2/bin/pm2-runtime
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] (node_modules/pm2/node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
ubuntu@ip-172-31-23-111:~/my-images$ docker images | grep adeacef979d1
my_nodejs_app 10.0 adeacef979d1 3 minutes ago 707MB
ubuntu@ip-172-31-23-111:~/my-images$ docker run -it -p 8086:8080 --name node_build10.1 --network new_bridge --ip 192.168.0.15 my_nodejs_app:10.0
-------------
/\\\\\\_/\\___/\\/\\\\_
[PM2] Spawning PM2 daemon with pm2_home=/root/.pm2
[PM2] PM2 Successfully daemonized
[PM2] Starting /src/app/hello.js in fork_mode (1 instance)
[PM2] Done.
┌──────────┬────┬──────┬─────┬────────┬─────────┬────────┬─────┬───────────┬──────┬──────────┐
│ App name │ id │ mode │ pid │ status │ restart │ uptime │ cpu │ mem │ user │ watching │
├──────────┼────┼──────┼─────┼────────┼─────────┼────────┼─────┼───────────┼──────┼──────────┤
│ hello │ 0 │ fork │ 20 │ online │ 0 │ 0s │ 1% │ 21.4 MB │ root │ disabled │
└──────────┴────┴──────┴─────┴────────┴─────────┴────────┴─────┴───────────┴──────┴──────────┘
Use pm2 show <id|name>
to get more details about an app
ubuntu@ip-172-31-23-111:~/my-images$
docker ps |grep my_nodejs_app
ubuntu@ip-172-31-23-111:~/my-images$ `
Please let me know how I can run the container continuously without getting it killed. My Dockerfile and hello.js code is attachhed with this.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.