Code Monkey home page Code Monkey logo

docker's Introduction

Dockerfiles and docker-compose.ymls for Nibyou's Services

This repository includes the docker configuration files used to run our services. Some services also have their own Dockerfiles, which will not be copied to this repo but live in the respective repos of the services themselves.

To get started, here is a small tutorial on how to install docker and docker-compose on Ubuntu 20.04 LTS, which our servers currently run on.

Docker

For possibly more up-to-date information, visit https://docs.docker.com/engine/install/ubuntu/

To start off, remove all old versions of the docker suite:

sudo apt-get remove docker docker-engine docker.io containerd runc

Update the apt-cache and install the needed software to add the sources list for dockers repo:

sudo apt-get update
sudo apt-get install ca-certificates curl gnupg lsb-release

Add dockers GPG Key and the the sources list to your apt sources:

curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg
echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null

Finally, update the apt-cache once more and install docker-ce, the docker-ce-cli and containerd.io:

sudo apt-get update
sudo apt-get install docker-ce docker-ce-cli containerd.io

Now, running sudo docker --version should not get you any errors.

docker compose

For possibly more up-to-date information, visit https://docs.docker.com/compose/install/

Docker-compose is now just a plugin for docker, you can install it using the docker-compose-plugin package:

sudo apt-get install docker-compose-plugin

To test the installation, you can run sudo docker compose version

With this done, check out the service's directories for Dockerfiles and docker-compose.ymls to run the services with.

Logging to Loki

Instead of using docker logs <container> every time, Docker can be set up to pipe it's logs to a Loki Instace.

To enable this, first install the grafana/loki-docker-driver Docker plugin:

docker plugin install grafana/loki-docker-driver:latest --alias loki --grant-all-permissions

And then, edit the Docker daemon config at /etc/docker/daemon.json:

sudo nano /etc/docker/daemon.json

And add the following configuration, with changes for the Loki server, of course:

{
    "log-driver": "loki",
    "log-opts": {
        "loki-url": "https://<user>:<password>@loki.example.com/loki/api/v1/push",
        "loki-batch-size": "400"
    }
}

Finally, restart Docker:

sudo systemctl restart docker

docker's People

Contributors

lucakiebel avatar

Watchers

 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.