Skip to content

Instantly share code, notes, and snippets.

@allandequeiroz
Last active October 25, 2018 19:43
Show Gist options
  • Save allandequeiroz/5f420337747a054d1c00436e721c0ac7 to your computer and use it in GitHub Desktop.
Save allandequeiroz/5f420337747a054d1c00436e721c0ac7 to your computer and use it in GitHub Desktop.
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
@camilamacedo86
Copy link

camilamacedo86 commented Aug 22, 2018

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