Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
creating a custom docker container
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Installing Gentoo
View previous topic :: View next topic  
Author Message
Adel Ahmed
Veteran
Veteran


Joined: 21 Sep 2012
Posts: 1158

PostPosted: Wed Mar 16, 2016 11:43 pm    Post subject: creating a custom docker container Reply with quote

I have been using systemd-nspawn for my VM jails for the past year or so

what I would do is use the ROOT= to emerge the bare minimum ackages I needed into a direcctory and then systemd-nspawn into it

I'm trying to do the same using docker containers but I'm a little lost, I'm unable to find any tutorials that do not involve downloading an image.

any ideas? thanks
Back to top
View user's profile Send private message
HerbMillerJW
n00b
n00b


Joined: 16 Feb 2012
Posts: 36

PostPosted: Thu Mar 17, 2016 2:26 am    Post subject: Reply with quote

Instead of systemd-nspawn'ing into the directory, you would create an image with it...

Code:
tar -C [image name] -c . | docker import - [image name]


Then deploy that image as a container with
Code:
docker run [image name]


See: https://docs.docker.com/engine/userguide/eng-image/baseimages/
Back to top
View user's profile Send private message
Adel Ahmed
Veteran
Veteran


Joined: 21 Sep 2012
Posts: 1158

PostPosted: Thu Mar 17, 2016 10:22 am    Post subject: Reply with quote

I have been trying to do that for a while now:
c containers # tar -C test -c . | docker import - test
6e50024816cdf11d744d38734f8bbac8b8d24b04398d0624c8815c78edee0944
pc containers # docker images
REPOSITORY TAG IMAGE ID CREATED VIRTUAL SIZE
test latest 6e50024816cd 4 seconds ago 2.894 MB
<none> <none> aa0879a4a866 11 hours ago 2.894 MB
<none> <none> 8d6e09e58a3d 14 hours ago 2.894 MB
pc containers # docker start test
Error response from daemon: no such id: test
Error: failed to start containers: [test]


:(
Back to top
View user's profile Send private message
Adel Ahmed
Veteran
Veteran


Joined: 21 Sep 2012
Posts: 1158

PostPosted: Sun Mar 20, 2016 2:29 am    Post subject: Reply with quote

bump
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Installing Gentoo All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum