欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

coffee-web.yaml

程序员文章站 2024-03-11 17:19:37
...

spring-boot项目简单测试…

项目地址

https://github.com/451817970-qq-com/coffee.git

镜像

vim sources.list

deb http://mirrors.aliyun.com/ubuntu/ bionic main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic main restricted universe multiverse
 
deb http://mirrors.aliyun.com/ubuntu/ bionic-security main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-security main restricted universe multiverse
 
deb http://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted universe multiverse
 
deb http://mirrors.aliyun.com/ubuntu/ bionic-proposed main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-proposed main restricted universe multiverse
 
deb http://mirrors.aliyun.com/ubuntu/ bionic-backports main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-backports main restricted universe multiverse

vim Dockerfile

FROM ubuntu:18.04
ENV LANG C.UTF-8
COPY sources.list /etc/apt/sources.list
RUN apt update
RUN apt install -y net-tools
RUN apt install -y telnet
RUN apt update && apt install -y openjdk-8-jre-headless
COPY coffee-web.jar /opt

docker build -t coffee-web:v1.0 .

coffee-web.yaml

apiVersion: v1
kind: Pod
metadata:
  name: coffee-web
spec:
  containers:
  - name: coffee-web-c
    image: coffee-web:v1.0
    resources:
      limits:
        memory: "200Mi"
      requests:
        memory: "100Mi"
    command: ['sh', '-c', 'java -jar /opt/coffee-web.jar']
    volumeMounts:
    - name: log
      mountPath: /var/log/apps
  volumes:
  - name: log
    hostPath:
      path: /var/log/apps
      type: Directory

相关标签: pod

推荐阅读