Git Product home page Git Product logo

docker-demo's Introduction

Docker 学习示例

nginx

通过 docker 起一个 nginx 服务,该服务可以让宿主机 80 端口访问网站

构建步骤:

  1. cd 到相关目录
  2. docker build -t "kokota/knginx" .
  3. docker-compose up -d

node

通过 docker 打包一个 node 服务,该服务包含了 node 和 redis 环境,相当于让代码跑在沙盒环境中

docker-compose 启动会生成独立网桥,对于多个互联的容器来说,需要自定义网桥,制定静态 IP 防止动态 IP

构建步骤:

  1. cd 到相关目录
  2. docker build -t "kokota/knode" .
  3. docker-compose up -d

jenkins

jenkinsci/blueocean 是一个 pipline 构建插件,非常方便实用,非常推荐

通过 本地构建示例 可以学习到如何简单使用 blue ocean 构建本地应用

通过 远程构建示例 可以学习到如何简单使用 blue ocean 构建远程库应用

通过 Webhook 示例 可以学习到如何使用 webhook 来完成项目提交后自动执行构建

如果出现 ERROR: Error fetching remote repo 'origin' 错误,这里有 一些解决方案,建议直接配置 Wipe out repository & force clone,每次都删掉库重新拉代码

如果出现 ... docker: not found,可能是因为你 agent 的是某个容器,容器里没有 docker,所以肯定会报错啊。此时把 agent 设置为 any 可以解决问题,具体的见 ./jenkins/web 里的 Jenkinsfile

启动 jenkins 步骤:

  1. cd 到相关目录
  2. docker-compose up -d

测试库在 这里,项目里有已经写好的 Dockerfile,用来构建前端项目的镜像

打包后发到远程服务器直接启动就可以了

docker-demo's People

Contributors

kokota avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.