Docker – porty, połączenie kontenerów

Udostępnienie portów

EXPOSE (Dockerfile) - udostępnione porty są otwarte dla innych kontenerów

--expose - tryb wykonawczy docker run - możliwy zakres portów. Nie mapuje portów hosta. 

  # docker run --expose=1000-200 ...

-p - jawne mapowanie portów z hostem (tryb wykonawczy) np.  

  # docker run -p 7000-8000:7000-8000 ...

  # docker run --name nginx -d -p 8080:80 nginx 

  # docker run --name nginx -d -p 8080:80 -p 443:443 nginx 

-P - mapowanie dynamiczne - proty hosta wybrane losowo dla każdego portu w EXPOSE lub --expose

  # docker run --name nginx -d -P nginx

Czytaj dalej Docker – porty, połączenie kontenerów

Docker – after installation Windows

Przykładowe ściągnięcie obrazu getting-started, uruchomienie konternera i wrzucenie obrazu do docker huba:

# docker run --name  repo alpine/git clone https://github.com/docker/getting-started.git

# docker cp repo:/git/getting-started .

# cd getting-started
# docker run -d -p 80:80 --name docker-tutorial docker101tutorial

# docker tag docker101tutorial jornathanx/docker101tutorial
# docker push jornathanx/docker101tutorial

Redis – konfiguracja

Główny plik konfiguracyjny

# nano /etc/redis/redis.conf

bind 127.0.0.1  - tylko localhost

# By default, if no "bind" configuration directive is specified, Redis listens
# for connections from all the network interfaces available on the server.
# It is possible to listen to just one or multiple selected interfaces using
# the "bind" configuration directive, followed by one or more IP addresses.

Czytaj dalej Redis – konfiguracja