this post was submitted on 01 Aug 2025
15 points (82.6% liked)

Selfhosted

50005 readers
356 users here now

A place to share alternatives to popular online services that can be self-hosted without giving up privacy or locking you into a service you don't control.

Rules:

  1. Be civil: we're here to support and learn from one another. Insults won't be tolerated. Flame wars are frowned upon.

  2. No spam posting.

  3. Posts have to be centered around self-hosting. There are other communities for discussing hardware or home computing. If it's not obvious why your post topic revolves around selfhosting, please include details to make it clear.

  4. Don't duplicate the full text of your blog or github here. Just post the link for folks to click.

  5. Submission headline should match the article title (don’t cherry-pick information from the title to fit your agenda).

  6. No trolling.

Resources:

Any issues on the community? Report it using the report flag.

Questions? DM the mods!

founded 2 years ago
MODERATORS
 

I have been fiddling with trying to build a Dockerfile and container for the following.

A Alpine Linix image with LFTP, cron, & openssh installed for use with my external server to sync folders.

I have a Alpine Linix VM that I connect with a external server using SSH keys, and a cron task running a LFTP script on schedule.

Any help or pointing me at a container you know of is appreciated.

top 9 comments
sorted by: hot top controversial new old
[–] elvith@feddit.org 10 points 17 hours ago (2 children)

I get LFTP and somewhat cron, but why OpenSSH? You can also SSH to the host and get into the container from there.

ITry to keep containers minimal, meaning only add what you absolutely need. Also I advise you to keep/consider the content of the container as immutable. If something's wrong, throw it away and restart with aa clean container. Data that you download should reside on a volume mapped to the container and this can usually also be accessed from the host. Same for any LFTP/cron config, etc.

So, what exactly is you plan why you need to SSH into the container itself? This post smells a bit like a XY Problem.

A quick google reveals that there are ready to go docker images with LFTP (which weighs about 7.5MB), which might be completely suitable for your need depending on your use case? https://hub.docker.com/r/minidocks/lftp/

[–] NarrativeBear@lemmy.world 1 points 9 hours ago (1 children)

I currently have a alpine linix VM where I had one time SSH'd into the remote server to exchange logon keys.

This means I can run my scripts without username and login credentials I just need to point to a key file instead.

I might be overthinking it like you said.

Though essentially I am trying to build a docker image of this same setup and can see I will need llfp and cron. Just not sure how to handle the key file at this point.

[–] CrackedLinuxISO@lemmy.dbzer0.com 2 points 3 hours ago (1 children)

What do you mean by handling the keyfile?

You can generate your ssh keys outside of docker and make them available in the container through a mounted directory. You will need to manually copy the public key to your remote host authorized_keys file anyway.

[–] NarrativeBear@lemmy.world 1 points 3 hours ago

Ahh yes that's what I was looking to do.

I was thinking if I already have a key file on the remote and local servers then I may not need shh installed on the docker container to do this setup.

[–] null_dot@lemmy.dbzer0.com 1 points 15 hours ago

I'd never heard of the XY Problem before.

I get it - big opportunity to waste lots of time.

However, while I've never posted a question on stack overflow or similar, a common complaint is that it's a toxic community because of responses related to this problem - a user asks about X and is accused of asking about Y and most responses undermine the premise being question Z.

[–] wesker@lemmy.sdf.org 16 points 21 hours ago (1 children)

You could create one. Learning how to put together your own Docker images is a rush.

[–] null_dot@lemmy.dbzer0.com 3 points 15 hours ago

I have been fiddling with trying to build a Dockerfile and container

[–] HelloRoot@lemy.lol 3 points 15 hours ago

Since I started using xPipe, everything looks like a nail.

Not sure if it is part of the free tier, but you can use xPipe to ssh directly into a docker container, on a remote server or on the local machine.

[–] nesc@lemmy.cafe 4 points 20 hours ago

~~why~~ You can create initful container (don't know if it possible with alpine) and run as many services inside it as you desire. Crons are pretty clunky inside containers and it's a lot easier to just run them from host using docker/podman container exec, writing containerfiles is pretty easy as well.