User Tools

Site Tools


docker

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
docker [2017/11/19 19:23] ssm2017docker [2022/02/07 13:29] (current) – external edit 127.0.0.1
Line 265: Line 265:
 The mysql server will be accessible from the outside on the port 6603. The mysql server will be accessible from the outside on the port 6603.
  
 +== User Namespaces ==
 +[[https://resourcepool.io/fr/2016/09/09/francais-le-user-namespace-dans-docker/|Source]]
 +[[https://www.jujens.eu/posts/en/2017/Jul/02/docker-userns-remap/|Source2]]
 +
 +BEWARE IT CAN BREAK AN OLD DOCKER INSTALLATION !!!
 +
 +<sxh bash>
 +groupadd -g 500000 dockremap && 
 +      groupadd -g 501000 dockremap-user && 
 +      useradd -u 500000 -g dockremap -s /bin/false dockremap && 
 +      useradd -u 501000 -g dockremap-user -s /bin/false dockremap-user
 +</sxh>
 +<sxh bash>
 +echo "dockremap:500000:65536" >> /etc/subuid && 
 +    echo "dockremap:500000:65536" >>/etc/subgid
 +</sxh>
 +<sxh>
 +{
 +    "userns-remap": "default"
 +}
 +</sxh>
 +<sxh bash>
 +systemctl daemon-reload && systemctl restart docker
 +</sxh>
 +== Portainer ==
 +in normal mode :
 +<sxh bash>
 +docker run -d --privileged -p 9000:9000 -v /var/run/docker.sock:/var/run/docker.sock -v /opt/portainer:/data portainer/portainer
 +</sxh>
 +in usernamespace mode :
 +<sxh bash>
 +docker run -d --privileged --userns=host -p 9000:9000 -v /var/run/docker.sock:/var/run/docker.sock -v /opt/portainer:/data portainer/portainer
 +</sxh>
 +
 +===== php-fpm nginx with php extensions =====
 +./docker-compose.yml
 +<sxh yml>
 +nginx:
 +  image: nginx:latest
 +  ports:
 +      - "80:80"
 +  volumes:
 +      - ./htdocs:/srv/www
 +      - ./conf.d:/etc/nginx/conf.d
 +  links:
 +      - php
 +php:
 +  build: ./docker/php
 +  volumes:
 +      - ./htdocs:/srv/www
 +</sxh>
 +./docker/php/Dockerfile
 +<sxh>
 +FROM php:7-fpm
 +RUN apt-get update && apt-get install -y --fix-missing  zip libzip-dev libpng-dev libonig-dev \
 +&& docker-php-ext-install gd \
 +&& docker-php-ext-install mbstring \
 +&& docker-php-ext-enable gd \
 +&& docker-php-ext-enable mbstring
 +</sxh>
 {{tag>docker}} {{tag>docker}}
docker.1511115810.txt.gz · Last modified: (external edit)