Running the Kestrel OSGi Runtime with Docker Machine by using aliyunec...

Works on OS X - 10.11.1

Kestrel OSGi Runtime

A custom distribution from Apache's Karaf
It's a lightweight, powerful, and enterprise ready container powered by OSGi

Check the version of docker-machine

docker-machine -v
docker-machine version 0.6.0, build e27fb87

Check the current PATH environment has been includes the /usr/local/bin

Download the aliyunecs driver and copy to /usr/local/bin

cd ~
mkdir aliyunecsdriver

curl -L https://drone.io/github.com/denverdino/machine/files/driver/docker-machine-driver-aliyunecs_darwin-amd64.tgz >driver-aliyunecs.tgz && tar xzf driver-aliyunecs.tgz -C aliyunecsdriver && rm driver-aliyunecs.tgz

mv aliyunecsdriver/docker-machine-driver-aliyunecs_darwin-amd64 /usr/local/bin/docker-machine-driver-aliyunecs

Setup the Environment variables by using the account info

export ECS_ACCESS_KEY_ID=xxx
export ECS_ACCESS_KEY_SECRET=xxxxx
export ECS_INSTANCE_TYPE=ecs.s1.small
export ECS_REGION=xxxx
export ECS_SSH_PASSWORD=xxx
export MACHINE_DOCKER_INSTALL_URL=http://acs-public-mirror.oss-cn-hangzhou.aliyuncs.com/docker-engine/internet

Creating a instance of Docker machine

docker-machine create --driver aliyunecs shellpays-dm1

Configuring shell

eval $(docker-machine env shellpays-dm1)

Pull the Kestrel from registry.aliyuncs.com/aves/kestrel:v4

docker pull registry.aliyuncs.com/aves/kestrel:v4

Run the kestrel as a instance of image

docker run -d -P --name kestrel_inst1 registry.aliyuncs.com/aves/kestrel:v4

Connecting the Console by using client

docker exec -it kestrel_inst1 client

console output sample

Logging in as karaf
981 [sshd-SshClient[66d2e7d9]-nio2-thread-2] WARN  _  __         _            _
| |/ /___  ___| |_ _ __ ___| |
| ' // _ \/ __| __| '__/ _ \ |
| . \  __/\__ \ |_| | |  __/ |
|_|\_\___||___/\__|_|  \___|_|

  Abacus Kestrel (4.0.0) Dynamic Modular Platform

Hit '<tab>' for a list of available commands
and '[cmd] --help' for help on a specific command.
Hit '<ctrl-d>' or 'system:shutdown' to shutdown Kestrel.

karaf@root()> list
START LEVEL 100 , List Threshold: 50
 ID | State  | Lvl | Version            | Name
------------------------------------------------------------------------------------
 10 | Active |  80 | 1.5.0              | OPS4J Base - Lang
 11 | Active |  80 | 1.5.0              | OPS4J Base - Service Provider Access
 12 | Active |  80 | 0.7.0              | OPS4J Pax JDBC Generic Driver Extender
 13 | Active |  80 | 0.7.0              | OPS4J Pax JDBC Config
 14 | Active |  80 | 1.8.1              | OPS4J Pax Swissbox :: OSGi Core
 15 | Active |  80 | 1.8.1              | OPS4J Pax Swissbox :: Extender
 16 | Active |  80 | 1.8.1              | OPS4J Pax Swissbox :: Lifecycle
 17 | Active |  80 | 1.0.0.201505202023 | org.osgi:org.osgi.service.jdbc
 18 | Active |  60 | 1.53               | bcprov
 19 | Active |  60 | 1.53               | bcprov-ext
 21 | Active |  60 | 5.1.37             | Oracle Corporation's JDBC Driver for MySQL
 23 | Active |  60 | 3.1.4              | Java UUID Generator
 25 | Active |  50 | 1.4.7              | JavaMail API (compat)
 29 | Active |  60 | 2.9.1              | Joda-Time
 49 | Active |  50 | 2.16.1             | camel-blueprint
 50 | Active |  50 | 2.16.1             | camel-catalog
 51 | Active |  80 | 2.16.1             | camel-commands-core
 52 | Active |  50 | 2.16.1             | camel-core
 53 | Active |  50 | 2.16.1             | camel-http-common

Show the runtime info

karaf@root()> shell:info
Karaf
  Karaf version               4.0.4
  Karaf home                  /usr/local/apache-karaf-4.0.4
  Karaf base                  /usr/local/apache-karaf-4.0.4
  OSGi Framework              org.apache.felix.framework-5.4.0

JVM
  Java Virtual Machine        xxx
  Version                     1.8.0xx
  Vendor                      xx
  Pid                         52
  Uptime                      4 minutes
  Total compile time          47.286 seconds
Threads
  Live threads                65
  Daemon threads              47
  Peak                        68
  Total started               101
Memory
  Current heap size           129,023 kbytes
  Maximum heap size           1,048,576 kbytes
  Committed heap size         1,048,576 kbytes
  Pending objects             0
  Garbage collector           Name = 'G1 Young Generation', Collections = 14, Time = 4.301 seconds
  Garbage collector           Name = 'G1 Old Generation', Collections = 0, Time = 0.000 seconds
Classes
  Current classes loaded      7,695
  Total classes loaded        7,695
  Total classes unloaded      0
Operating system
  Name                        Linux version 3.13.0-32-generic
  Architecture                amd64
  Processors                  
优秀的个人博客,低调大师

微信关注我们

原文链接:https://yq.aliyun.com/articles/8531

转载内容版权归作者及来源网站所有!

低调大师中文资讯倾力打造互联网数据资讯、行业资源、电子商务、移动互联网、网络营销平台。持续更新报道IT业界、互联网、市场资讯、驱动更新,是最及时权威的产业资讯及硬件资讯报道平台。

相关文章

发表评论

资源下载

更多资源
优质分享Android(本站安卓app)

优质分享Android(本站安卓app)

近一个月的开发和优化,本站点的第一个app全新上线。该app采用极致压缩,本体才4.36MB。系统里面做了大量数据访问、缓存优化。方便用户在手机上查看文章。后续会推出HarmonyOS的适配版本。

Mario,低调大师唯一一个Java游戏作品

Mario,低调大师唯一一个Java游戏作品

马里奥是站在游戏界顶峰的超人气多面角色。马里奥靠吃蘑菇成长,特征是大鼻子、头戴帽子、身穿背带裤,还留着胡子。与他的双胞胎兄弟路易基一起,长年担任任天堂的招牌角色。

Apache Tomcat7、8、9(Java Web服务器)

Apache Tomcat7、8、9(Java Web服务器)

Tomcat是Apache 软件基金会(Apache Software Foundation)的Jakarta 项目中的一个核心项目,由Apache、Sun 和其他一些公司及个人共同开发而成。因为Tomcat 技术先进、性能稳定,而且免费,因而深受Java 爱好者的喜爱并得到了部分软件开发商的认可,成为目前比较流行的Web 应用服务器。

Java Development Kit(Java开发工具)

Java Development Kit(Java开发工具)

JDK是 Java 语言的软件开发工具包,主要用于移动设备、嵌入式设备上的java应用程序。JDK是整个java开发的核心,它包含了JAVA的运行环境(JVM+Java系统类库)和JAVA工具。