Coder Social home page Coder Social logo

dockertipstricks's Introduction

Docker Tips & Tricks

Some best practices of docker and microservices

Before start editing

  1. Here is the link to markdown cheatsheet

Introduction

This helps in understanding some tips and best practices while building containers with Docker.

Some of the Best practices are documented in the link:

  1. Docker Best practices
  2. Why using multiple RUN in docker file does not solve long RUN lines

Highlights of Best practices

  1. Run only one process per container
  2. Minimize the number of layers
  3. Sort arguments which are passed to scripts or commands.
  4. Why to run apache in foreground:Run Apache in foreground. We need to run the apache process in the foreground, since our container will stop when the process specified in the docker run command stops. We can do this with a flag -D when starting the apache2 process: /usr/sbin/apache2ctl -D FOREGROUND
  5. Permanently running a container: While the sections above explained how to run a container when configuring it, for a production setup, you should not manually start and babysit containers. Instead, create a systemd unit file to make systemd keep that container running.
  6. Systemd to manage the lifecycle of your Docker containers

dockertipstricks's People

Contributors

hackranger 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.