Showing posts with label docker. Show all posts
Showing posts with label docker. Show all posts

Wednesday, May 18, 2022

How to Assign a Static IP to a Docker Container

 Ref: https://www.howtogeek.com/devops/how-to-assign-a-static-ip-to-a-docker-container/

Setting Up Static IPs

First, you’ll need to set up a Docker network, and since we care about the IP address, you’ll need to specify a fixed subnet:

docker network create --subnet=172.20.0.0/16 customnetwork

Then, you can run a container, specifying the network with the --net flag, and specifying the IP with the -ip flag:

docker run --net customnetwork --ip 172.20.0.10 -d container



Tuesday, May 10, 2022

Package 'mysql-client' has no installation candidate in php-fpm image build using docker compose

Ref: https://stackoverflow.com/questions/57048428/e-package-mysql-client-has-no-installation-candidate-in-php-fpm-image-build-u

 php:7.3-fpm now use Debian 10 (Buster) as its base image and Buster ships with MariaDB, so just replace mysql-client with mariadb-client should fix it.

[Docker] grep versions in BusyBox don't support "grep -oP"

 


Ref: https://github.com/firehol/firehol/issues/325

Working with "grep -E" seems to work. Maybe this could be a workaround.

Docker not found when building docker image using Docker Jenkins container pipeline

 


Ref: https://localcoder.org/docker-not-found-when-building-docker-image-using-docker-jenkins-container-pipel

Solution 5:

docker run -d \
--group-add docker \
-v $(pwd)/jenkins_home:/var/jenkins_home \
-v /var/run/docker.sock:/var/run/docker.sock \
-v $(which docker):/usr/bin/docker \
-p 8080:8080 -p 50000:50000 \
jenkins/jenkins:lts

Just add option --group-add docker when docker run.


Wednesday, November 4, 2020

How to get a list of images on docker registry v2

 List all repositories (effectively images):

curl -X GET https://myregistry:5000/v2/_catalog
> {"repositories":["redis","ubuntu"]}

List all tags for a repository:

curl -X GET https://myregistry:5000/v2/ubuntu/tags/list
> {"name":"ubuntu","tags":["14.04"]}

Friday, August 28, 2020

Docker insecure registry

 Edit file /usr/lib/systemd/system/docker.service

add --insecure-registry=myregistrydomain.com:5000

to line 

ExecStart=/usr/bin/dockerd -H fd:// --containerd=/run/containerd/containerd.sock


reload and restart docker service

systemctl daemon-reload

service docker restart

Install and use xorg-server on macOS via Homebrew

  The instructions to install and use xorg-server on macOS via Homebrew: Install Homebrew (if you haven't already): /bin/bash -c ...