Sign inSign up

hochzehn/s3cmd

By hochzehn

•Updated over 8 years ago

s3cmd in Docker

Image
0

100K+

hochzehn/s3cmd repository overview

⁠s3cmd-docker

⁠Credits

This repo is based on sekka1/docker-s3cmd⁠, but we modified the way it works quite heavily.

⁠Badges

GitHub forks GitHub stars GitHub issues Twitter Docker Pulls Docker Stars

⁠What is this?

s3cmd⁠ in a Docker container. This is useful if you are already using Docker. You can simply pull this container to that Docker server and move things between the local box and S3 by just running a container.

Using Alpine linux⁠. This image is ~15MB.

You can find an automated build of this container on the Docker Hub: hochzehn/s3cmd⁠

⁠How to use

⁠Copy from local to S3:

AWS_KEY=<YOUR AWS KEY>
AWS_SECRET=<YOUR AWS SECRET>
BUCKET=s3://your-bucket-name/
LOCAL_FILE=/tmp/database

docker run --rm \
  --env aws_key=${AWS_KEY} \
  --env aws_secret=${AWS_SECRET} \
  --env cmd=sync-local-to-s3 \
  --env DEST_S3=${BUCKET}  \
  -v ${LOCAL_FILE}:/opt/src \
  hochzehn/s3cmd
  • Change LOCAL_FILE to file/folder you want to upload to S3
  • Append any options to pass to s3cmd at the end, e.g. --delete-removed: ... hochzehn/s3cmd --delete-removed

⁠Copy from S3 to local:

AWS_KEY=<YOUR AWS KEY>
AWS_SECRET=<YOUR AWS SECRET>
BUCKET=s3://your-bucket-name/
LOCAL_FILE=/tmp

docker run --rm \
  --env aws_key=${AWS_KEY} \
  --env aws_secret=${AWS_SECRET} \
  --env cmd=sync-s3-to-local \
  --env SRC_S3=${BUCKET} \
  -v ${LOCAL_FILE}:/opt/dest \
  hochzehn/s3cmd
  • Change LOCAL_FILE to the file/folder to download the files from S3 to
  • Append any options to pass to s3cmd at the end, e.g. --delete-removed: ... hochzehn/s3cmd --delete-removed

⁠Run any s3cmd command

AWS_KEY=<YOUR AWS KEY>
AWS_SECRET=<YOUR AWS SECRET>

docker run -rm \
  --env aws_key=${AWS_KEY} \
  --env aws_secret=${AWS_SECRET} \
  hochzehn/s3cmd \
  ls /

Tag summary

Content type

Image

Digest

Size

14.4 MB

Last updated

over 8 years ago

docker pull hochzehn/s3cmd