Skip to content

Docker container for hosting an SFTP in Azure Container Instances

License

Notifications You must be signed in to change notification settings

ARKlab/ACI-SFTP

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ACI-SFTP

OpenSSH logo

BREAKING: Move from DockerHub to Github Packages

Due to Free Team tier being sunset by DockerHub, ARK is going to deprecate Docker image repositoy.

Update your deployments from arkenergy/aci-sftp:latest to ghcr.io/arklab/aci-sftp:latest.

Host SFTP on Azure Container Instances

This image is based on atmoz/sftp:latest with the addition of sourcing SSH Keys from /ssh

Azure Container Instances doesn't allow to mount single files but only folders. Mounting /etc/ssh for using stable keys would override the /etc/ssh/ssh_config and other files present in /etc/ssh.

This image copy ssh_host_*key files present in /ssh to /etc/ssh on startup. This way is possible to mount keys as ACI's secrets in /ssh.

Example

apiVersion: 2018-10-01
location: westeurope
name: myContainerGroup
properties:
  containers:
  - name: sftp
    properties:
      image: ghcr.io/arklab/aci-sftp:latest
      resources:
        requests:
          cpu: 1
          memoryInGb: 1
      ports:
      - port: 22
      volumeMounts:
      - mountPath: /ssh
        name: sshkeys
  osType: Linux
  volumes:
  - name: sshkeys
    secret:
      ssh_host_rsa_key: your_base64_key
      ssh_host_ed25519_key: your_base64_key
  ipAddress:
    type: Public
    ports:
    - protocol: tcp
      port: 22
tags: null
type: Microsoft.ContainerInstance/containerGroups
# Deploy with YAML template
az container create \
  --resource-group myResourceGroup \
  --file aci-sftp.yaml

Tip: you can generate your keys with these commands:

ssh-keygen -t ed25519 -f ssh_host_ed25519_key < /dev/null
ssh-keygen -t rsa -b 4096 -f ssh_host_rsa_key < /dev/null

and then you can obtain the base64 string to use in ACI Secrets with these:

base64 -w0 ssh_host_ed25519_key
base64 -w0 ssh_host_rsa_key

About

Docker container for hosting an SFTP in Azure Container Instances

Resources

License

Stars

Watchers

Forks

Packages