Tech C**P
15 subscribers
161 photos
9 videos
59 files
304 links
مدرس و برنامه نویس پایتون و لینوکس @alirezastack
Download Telegram
Docker can set different log drivers for its logging mechanism it can be json file, syslog, fluentd and so on. The default is set to json-file and these log files are located in /var/lib/docker/containers/. You can check type of your log in docker using:

$ docker inspect -f '{{.HostConfig.LogConfig.Type}}' <CONTAINER>
json-file

Instead of <CONTAINER> put your currently running container id.


To read more about this head on to: https://docs.docker.com/config/containers/logging/configure/#configure-the-logging-driver-for-a-container


#docker #log #log_driver
CoreOS (one of the most used docker base images) has been acquired by Red Hat with $250 million.

Read on:
- https://coreos.com/blog/coreos-agrees-to-join-red-hat/?utm_source=DevOps%27ish&utm_campaign=c766654b17- EMAIL_CAMPAIGN_2018_02_04&utm_medium=email&utm_term=0_eab566bc9f-c766654b17-46016105

#linux #coreos #redhat #docker
If you are building a docker image using docker build and you want to force building the package use --no-cache:

docker build --no-cache


#docker #build #no_cache #cache #force
Netflix has open sourced his container management system called Titus written in Go Lang. You can see documentation of it here:

- https://netflix.github.io/titus/

Source code and Docs:

- https://github.com/Netflix/titus

#container_orchestration #docker #container #golang #go #netflix #titus #aws
To run grafana in Docker:

docker run -d -p 3000:3000 grafana/grafana


Now if you want to install specific plugins you need to provide the name as an environment variable GF_INSTALL_PLUGINS:

docker run \
-d \
-p 3000:3000 \
--name=grafana \
-e "GF_INSTALL_PLUGINS=grafana-clock-panel,grafana-simple-json-datasource" \
grafana/grafana


#grafana #docker #plugins
Run newest elasticsearch image on linux using docker:

run -d -p 9200:9200 -v /srv/esdata:/usr/share/elasticsearch/data -p 9300:9300 -e "discovery.type=single-node" docker.elastic.co/     elasticsearch/elasticsearch:6.2.4
#docker #es #elasticsearch
Minio is an object storage server that is compatible with Amazon S3. You can run your own object storage server using docker:
- https://docs.minio.io/docs/minio-docker-quickstart-guide

And you can use its Python SDK in order to talk to its endpoint API:
- https://github.com/minio/minio-py

It's usage is very simple and elegant. If you are unfamiliar with object storage read more here:
- https://en.wikipedia.org/wiki/Object_storage

#minio #python #sdk #docker #object_storage
In docker swarm mode you can list nodes with docker node ls. If you want to assign a label to each node you can use the below command to update node labels. For example you can assign a key=value pair like role=storage to one of your node listed with the first command:

docker node update --label-add role=storage YOUR_HOSTNAME

Read more here:
- https://docs.docker.com/engine/swarm/manage-nodes/#update-a-node

The great thing about this labeling is in docker compose file that you can tell docker which server should get deployed on which server (node):

deploy:
replicas: 4
placement:
constraints:
- node.labels.role == storage

NOTE: role is something that we ourselves have been defined. You can define your own as requirements vary.


#docker #node #swarm #label #role
Linux in Docker: Wheezy: "ps: command not found"

Solution:

RUN apt-get update && apt-get install -y procps


#docker #linux #ps #command_not_found #procps
Hello Docker geeks :)

If you run a container and attach to that container you would see its stin, stout or stderr outputs. If you press CTRL+C while you're attached to the container the container will get stopped. In order to detach from the container you can use key sequence CTRL+ p + CTRL+q.

One of the reasons that CTRL+C stops the container is that this key combination sends SIGKILL signal to the container. There is a
parameter called --sig-proxy that is true by default which makes CTRL+C to send SIGINT. You can detach from a container and leave it running using the CTRL-p CTRL-q key sequence.

If you set --sig-proxy to false then CTRL+C would not kill the running container:

docker attach YOUR_CONTAINER_ID --sig-proxy=false

NOTE: you can get container id by issuing docker ps command.

#docker #attach #detach #sig_proxy #sequence_key #SIGINT #SIGKILL
How to start a jetbrains license server on your own host using Docker:

docker run -d -p 8000:80 --name jetbrains-license-server \
-e TZ="Europe/Paris" \
-e JLS_VIRTUAL_HOSTS=jetbrains-license-server.example.com \
-v $(pwd)/data:/data \
crazymax/jetbrains-license-server:latest


There are many env variables you can set as JLS_VIRTUAL_HOSTS above:

TZ : The timezone assigned to the container (default UTC)
JLS_VIRTUAL_HOSTS : Virtual hosts where license server will be available (comma delimited for several hosts)
JLS_CONTEXT : Context path used by the license server (default /)
JLS_ACCESS_CONFIG : JSON file to configure user restrictions (default /data/access-config.json)
JLS_STATS_RECIPIENTS : Reports recipients email addresses for stats (comma delimited)
JLS_REPORT_OUT_OF_LICENSE : Warn about lack of licenses every hour following the percentage threshold (default 0)
JLS_SMTP_SERVER : SMTP server host to use for sending stats (stats disabled if empty)
JLS_SMTP_PORT : SMTP server port (default 25)
JLS_SMTP_USERNAME : SMTP username (auth disabled if empty)
JLS_SMTP_PASSWORD : SMTP password (auth disabled if empty)
JLS_STATS_FROM : From address for stats emails
JLS_STATS_TOKEN : Enables an auth token for the stats API at /reportApi (HTTP POST)

Volumes:
/data : Contains registration data and configuration

Ports:
`80 : Jetbrains License Server HTTP port

Github removes repos related to crack and license, copy or download content from the below link:

- https://github.com/crazy-max/docker-jetbrains-license-server

#docker #license_server #jetbrains #crazymax