4

I have a Java EE packaged as war file stored in an AWS s3 bucket. I will like to mount the folder containing the .war file as a point in my docker container. I have managed to do this on my local machine. Below is an example of a JBoss wildfly deployments. How can I use s3 for this ?

docker container run -d —name Application -p 8080:8080 -v `pwd` /Application.war: /opt/jboss/wildfly/standalone/deployments/Application.war jboss/wildlfly

christian Martin
  • 85
  • 1
  • 1
  • 5

4 Answers4

4

Yes , you can ( and in swarm mode you should )

Bash Stack
  • 141
  • 2
3

No you can't.

S3 is an object storage, accessed over HTTP or REST for example. Just as you can't mount an HTTP address as a directory you can't mount a S3 bucket as a directory.

Having said that there are some workarounds that expose S3 as a filesystem - e.g. 's3fs' project. How reliable and stable they are I don't know.

MLu
  • 1,011
  • 5
  • 7
2

Actually, you can use Fuse (eluded to by the answer above).

S3FS-FUSE: This is a free, open-source FUSE plugin and an easy-to-use utility which supports major Linux distributions & MacOS. S3FS also takes care of caching files locally to improve performance. This plugin simply shows the Amazon S3 bucket as a drive on your system.

https://tecadmin.net/mount-s3-bucket-centosrhel-ubuntu-using-s3fs/

I haven't used it in AWS yet, though I'll be trying it soon. There is a similar solution for Azure blob storage and it worked well, so I'm optimistic.

John Humphreys
  • 1,570
  • 7
  • 18
0

Yes, you can. Use Storage Gateway service. It will give you a NFS endpoint. Mount that using kubernetes volumn. It is possible. I have already achieved this.

again
  • 189
  • 5