docker

作者: AbsurdOS | 来源:发表于2017-06-07 15:50 被阅读0次

docker+redis:
Dockerfile

FROM centos:latest
MAINTAINER Absurd "www_1350@163.com"

RUN yum -y update &&  yum -y install epel-release && yum -y install redis && yum -y install net-tools

# redis
ENTRYPOINT [ "/usr/bin/redis-server" ]
EXPOSE 6379

docker build -t absurd/rick-redis .

docker+java:
Dockerfile

FROM absurd/rick-redis:latest
MAINTAINER Absurd "www_1350@163.com"
ENV REFRESHED_AT 2017-06-06

# Install curl wget
#RUN yum -y install curl
#RUN yum -y install wget

# install jdk8
RUN cd /tmp
# &&  curl -L 'http://download.oracle.com/otn-pub/java/jdk/8u131-b11/d54c1d3a095b4ff2b6607d096fa80163/jdk-8u131-linux-x64.tar.gz' -H 'Cookie: oraclelicense=accept-securebackup-cookie; gpw_e24=Dockerfile' | tar -xz
ADD docker/jdk-8u131-linux-x64.tar.gz /tmp/
RUN mkdir -p /usr/lib/jvm
RUN mv /tmp/jdk1.8.0_131/ /usr/lib/jvm/jdk8/
# Set Oracle JDK 7 as default Java
RUN update-alternatives --install /usr/bin/java java /usr/lib/jvm/jdk8/bin/java 300
RUN update-alternatives --install /usr/bin/javac javac /usr/lib/jvm/jdk8/bin/javac 300

# maven
RUN mkdir /var/tmp/maven
#RUN wget -P /var/tmp/maven  http://apache.fayea.com/maven/maven-3/3.3.9/binaries/jdk-8u131-linux-x64.tar.gz
#RUN tar xzf /var/tmp/maven/apache-maven-3.3.9-bin.tar.gz -C /var/tmp/maven
#RUN rm -rf /var/tmp/maven/apache-maven-3.3.9-bin.tar.gz
ADD docker/apache-maven-3.5.0-bin.tar.gz /var/tmp/maven/
ADD docker/settings.xml ~/.m2/settings.xml

ENV JAVA_HOME /usr/lib/jvm/jdk8/
ENV M2_HOME /var/tmp/maven/apache-maven-3.5.0
ENV PATH $PATH:$JAVA_HOME/bin:$M2_HOME/bin

jdk-8u131-linux-x64.tar.gz/jdk-8u131-linux-x64.tar.gz/settings.xml
都放在docker目录下,因为我网比较卡

docker build -t absurd/rick-java-redis .

微服务:

FROM absurd/rick-java-redis:latest
MAINTAINER Absurd "www_1350@163.com"
ENV REFRESHED_AT 2017-06-06
WORKDIR /code

ADD target /code/target

#RUN ["mvn", "package","-Dmaven.test.skip=true"]

ENTRYPOINT ["java", "-jar", "target/rick-1.0-SNAPSHOT.jar"]

EXPOSE 8080

docker build -t absurd/rick-app .
docker run -ti
-p 8080:8080
--name rick_app
absurd/rick-app:latest \

相关文章

  • docker学习

    docker镜像 docker容器 docker仓库 安装docker docker版本 docker分为社区版和...

  • Docker安装和运行

    获取Docker 安装Docker 验证安装 1、获取Docker Docker for Mac Docker f...

  • Docker知识手册

    Docker 容器 启动docker:docker start 查看docker运行状态:docker stats...

  • Docker简介

    章节介绍 # Docker是什么# Docker包括什么# Docker镜像# Docker编配# Docker还...

  • Docker 常用操作

    Docker docker: 18.09.4、nvidia-docker: 2.0.3 docker 19.03 ...

  • rancher+harbor离线安装

    安装docker,此docker为社区版docker。docker官方文档:https://docs.docker...

  • Linux之Docker

    Linux之Docker 目录 Docker简单介绍 在线Docker安装 离线Docker安装 Docker简单...

  • Docker常用命令

    Docker常用命令 Docker帮助命令 docker version:查看docker版本 docker in...

  • Docker基础操作

    Docker部署 Docker安装 镜像加速 Docker 基础命令 Docker镜像管理 搜索镜像docker ...

  • docker容器状态查看命令集

    docker inspect 用法 : docker inspect [docker名称/docker short...

网友评论

      本文标题:docker

      本文链接:https://www.haomeiwen.com/subject/lifafxtx.html