Windows Server 2019 Docker Pull异常#
no matching manifest for windows/amd64 10.0.20348 in the manifest list entries
![](/images/docker-pull-error1.png)
解决办法:#
找到对应服务并关闭,点击停止
![](/images/docker-pull-error2.png)
cmd regedit
打开注册表,更改注册表,在如图位置添加参数--experimental=true
![](/images/docker-pull-error3.png)
- 再次启动
Docker Engine
服务
![](/images/docker-pull-error4.png)
docker pull mysql:5.7.37
Windows Server 部署jenkins#
docker pull mysql:5.7.37
docker pull jenkinsci/blueocean
docker run -p 5080:8080 -uroot -d -v /var/run/docker.sock:/var/run/docker.sock jenkinsci/blueocean
docker-compose 应用 (kafka)#
在windows docker中安装kafka通过docker-compose命令
新建docker-compose.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
| version: '3'
services:
zookeeper:
image: wurstmeister/zookeeper
ports:
- "2181:2181"
kafka:
image: wurstmeister/kafka
depends_on:
- zookeeper
ports:
- "9092:9092"
environment:
KAFKA_ADVERTISED_HOST_NAME: 192.168.171.131
KAFKA_CREATE_TOPICS: "test:3:1"
KAFKA_ZOOKEEPER_CONNECT: zookeeper:2181
|
保存后,cmd定位至docker-compose.yml文件目录,运行docker-compose up -d
up:启动
down:停止
-d:后台运行
KAFKA_ADVERTISED_HOST_NAME:宿主机的ip地址,docker服务器ip
KAFKA_CREATE_TOPICS: “test:3:1”:test为topic名称,3个分区,1个备份
KAFKA_ZOOKEEPER_CONNECT: kafka依赖 zookeeper 端口2181
.net 简单使用kafka#
安装 Install-Package Confluent.Kafka
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
| static async Task Main(string[] args)
{
ThreadPool.QueueUserWorkItem(async (o) => await Produce());
ThreadPool.QueueUserWorkItem(async (o) => await Subscrib());
Console.ReadLine();
}
static async Task Produce()
{
Console.WriteLine("Hello World Producer!");
var config = new ProducerConfig
{
BootstrapServers = "192.168.171.131:9092",
ClientId = Dns.GetHostName(),
};
using (var producer = new ProducerBuilder<Null, string>(config).Build())
{
string topic = "test";
for (int i = 0; i < 100; i++)
{
var msg = "message " + i;
Console.WriteLine($"Send message: value {msg}");
var result = await producer.ProduceAsync(topic, new Message<Null, string> { Value = msg });
Console.WriteLine($"Result: key {result.Key} value {result.Value} partition:{result.TopicPartition}");
Thread.Sleep(500);
}
}
}
static async Task Subscrib()
{
Console.WriteLine("Hello World kafka consumer !");
var config = new ConsumerConfig
{
BootstrapServers = "192.168.171.131:9092",
GroupId = "foo",
AutoOffsetReset = AutoOffsetReset.Earliest
};
var cancel = false;
using (var consumer = new ConsumerBuilder<Ignore, string>(config).Build())
{
var topic = "test";
consumer.Subscribe(topic);
while (!cancel)
{
var consumeResult = consumer.Consume(CancellationToken.None);
Console.WriteLine($"获取消息Consumer message: {consumeResult.Message.Value} topic: {consumeResult.Topic} Partition: {consumeResult.Partition}");
}
consumer.Close();
}
}
|
部署php apache镜像 docker compose编排#
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
| services:
myxampp:
#镜像名
image: tomsik68/xampp
# 容器名称
container_name: myxampp_x1
# command: -d
# 重启
restart: always
# 挂载
volumes:
#容器文件挂载
- type: bind
# 宿主机路径
source: /usr/local/kl_public_html
# 容器路径
target: /opt/lampp/htdocs
- type: bind
source: /usr/local/docker/xmapp/apache
target: /var/log/apache2
# 端口映射
ports:
- "9803:22"
- "9000:80"
# 使用 docker compose up -d
# -d 表示后端运行
|