godarch / darch

A tool for building and booting stateless and immutable images, bare metal.
https://godarch.com/
MIT License
832 stars 32 forks source link

A couple of questions #41

Closed phunni closed 4 years ago

phunni commented 4 years ago

I managed to get a custom image built and booting - it didn't do much (was a very basic install of arch), but I was pleased at how straight forward it was!

Going forward, there are a couple of things I can't seem to figure out:

1) Everyone who uses darch seems to be hosting their own pacman repository for aur packages, but I cannot, for the life of me figure out how to do this! The clearest documentation I could find via google used github and aurutils, but it was out of date and the author said he wasn't going to updates since it doesn't work anymore! 2) I'm hoping to use one of the machines on my network as a build server, but I'm not really familiar with how containerd works - is it possible to pull built images from a containerd instance on the network? Presumably I then need to only do the pull and then run darch stage to deploy locally?

pauldotknopf commented 4 years ago

Glad you got up and running!

I used to use Arch as well, but have switched to Ubuntu. Maybe this will help.

https://github.com/pauldotknopf/binary-repos/tree/arch-linux

However, this is only needed to use pre-compiled AUR packages. If you are ok with long build times, don't bother with AUR and just build/installll directly in your recipe.

As for network build servers, I would push your images to dockerhub and pull them down from there.

phunni commented 4 years ago

Is it not possible to use a remote (as in hosted on my local network) containerd instance and simply pull to the clients from there?

phunni commented 4 years ago

Or, indeed, any other way of doing it all on the local network?

phunni commented 4 years ago

Also, I'm now trying to push to dockerhub hoping i can use darch images push rather than using docker directly (not that it would that much of an issue if I had to), but I can't figure out the appropriate syntax - how do I specify the repository url? I've tried:

darch images push --user phunni:**** hub.docker.com/repository/docker/phunni/darch/base

and

darch images push --user phunni:**** docker.io/phunni/darch/base

!base" being the image I wan to push, but it always fails saying it can't find the image and then quoting the full url as the image name...

phunni commented 4 years ago

bump...

phunni commented 4 years ago

OK - nevermind. I figured out how to push to dockerhub, or, at least, I've made enough progress to be going on with! :-)

pauldotknopf commented 4 years ago

Sorry for not responding, things have been hectic at work.

You don't need the docker.io when pushing, that is handled for you. See this.

#!/bin/bash
set -e

. ./build

while read -r IMAGE; do
    sudo darch images push --user $DOCKER_LOGIN_USERNAME:$DOCKER_LOGIN_PASSWORD pauldotknopf/darch-ubuntu-$IMAGE:$TAG
    sudo darch images push --user $DOCKER_LOGIN_USERNAME:$DOCKER_LOGIN_PASSWORD pauldotknopf/darch-ubuntu-$IMAGE:latest
done <<< "$IMAGES"

With containerd, I don't think there is a way to access it over the network. Although it does communicate through a socket (grpc), the API returns local paths that are expected to exist on your system.

phunni commented 4 years ago

Thanks for the reply! Presumably, that means that you either need lots of public repositories for each build type - or a paid account for all the private ones? If one wanted to use a local docker installation, how would they go about specifying that instead of docker.io?

pauldotknopf commented 4 years ago

Thanks for the reply! Presumably, that means that you either need lots of public repositories for each build type - or a paid account for all the private ones?

Correct.

If one wanted to use a local docker installation, how would they go about specifying that instead of docker.io?

Tag your images as "yourdomain.com/your/image:latest" and push.

phunni commented 4 years ago

Are there ot any security concerns about having all your images available publicly?