Last active
October 25, 2018 19:43
-
-
Save allandequeiroz/5f420337747a054d1c00436e721c0ac7 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from fedora | |
RUN dnf install python-pip -y | |
RUN dnf -y install dnf-plugins-core | |
RUN dnf config-manager --add-repo https://download.docker.com/linux/fedora/docker-ce.repo | |
RUN dnf config-manager --set-disabled docker-ce-test | |
RUN dnf config-manager --set-disabled docker-ce-edge | |
RUN dnf install docker-ce -y | |
RUN pip install docker-compose | |
CMD ["systemctl","start","docker"] | |
----------------------------- | |
docker build -t fedora-docker-in-docker . | |
----------------------------- | |
#!/bin/bash | |
docker run -d \ | |
--rm \ | |
--name fdid \ | |
-e=container=docker \ | |
--stop-signal=SIGRTMIN+3 \ | |
--cap-add=SYS_ADMIN \ | |
--security-opt=seccomp:unconfined \ | |
--privileged \ | |
-v /sys/fs/cgroup:/sys/fs/cgroup:ro \ | |
fedora-docker-in-docker \ | |
/sbin/init | |
docker exec -it fdid bash | |
-----------by-hand----------- | |
docker run -d --name fedora28 -e=container=docker --stop-signal=SIGRTMIN+3 --cap-add=SYS_ADMIN --security-opt=seccomp:unconfined --privileged -v /sys/fs/cgroup:/sys/fs/cgroup:ro fedora /sbin/init | |
docker exec -it fedora28 bash | |
dnf install python-pip -y | |
dnf -y install dnf-plugins-core | |
dnf config-manager --add-repo https://download.docker.com/linux/fedora/docker-ce.repo | |
dnf config-manager --set-disabled docker-ce-test | |
dnf config-manager --set-disabled docker-ce-edge | |
dnf install docker-ce -y | |
pip install docker-compose | |
systemctl start docker |
Following the same container with the --privileged
.
cmacedo@camilas-MBP ~ $ docker exec -it --privileged fedora28 bash
[root@b5a5ff19a5b4 /]# systemctl start docker
Job for docker.service failed because the control process exited with error code.
See "systemctl status docker.service" and "journalctl -xe" for details.
[root@b5a5ff19a5b4 /]# exit
exit
cmacedo@camilas-MBP ~ $ docker exec -it --privileged=true fedora28 bash
[root@b5a5ff19a5b4 /]# systemctl start docker
Job for docker.service failed because the control process exited with error code.
See "systemctl status docker.service" and "journalctl -xe" for details.
[root@b5a5ff19a5b4 /]#
PS.: I don't think pip install docker-compose
is required
Following the result with the image,
96b5ccbdd42c515c504aad38bc380e056a360cc2662c3b94ae722c27e65cfc2e
cmacedo@camilas-MBP ~/docker $ docker exec -it --rm fdid bash
unknown flag: --rm
See 'docker exec --help'.
cmacedo@camilas-MBP ~/docker $ docker exec -it fdid bash
[root@96b5ccbdd42c /]# systemctl start docker
Job for docker.service failed because the control process exited with error code.
See "systemctl status docker.service" and "journalctl -xe" for details.
[root@96b5ccbdd42c /]#
PS.: The --rm
param did not work.
[root@96b5ccbdd42c /]# docker run hello-world
docker: Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?.
See 'docker run --help'.
[root@96b5ccbdd42c /]#
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Following the result of the manually steps. ( same of before )