-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy pathDockerfile
42 lines (33 loc) · 1.32 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
FROM ubuntu:18.04
## Some utilities
RUN apt-get update -y && \
apt-get install -y build-essential libfuse-dev libcurl4-openssl-dev libxml2-dev pkg-config libssl-dev mime-support automake libtool wget tar git unzip
RUN apt-get install lsb-release -y && apt-get install zip -y && apt-get install vim -y
## Install S3 Fuse
RUN rm -rf /usr/src/s3fs-fuse
RUN git clone https://github.com/s3fs-fuse/s3fs-fuse/ /usr/src/s3fs-fuse
WORKDIR /usr/src/s3fs-fuse
RUN ./autogen.sh && ./configure && make && make install
## Create folder
WORKDIR /var/www
RUN mkdir s3
## Set Your AWS Access credentials
ARG AWS_ACCESS_KEY=$AWS_ACCESS_KEY
ENV AWS_ACCESS_KEY=$AWS_ACCESS_KEY
ARG AWS_SECRET_ACCESS_KEY=$AWS_ACCESS_KEY
ENV AWS_SECRET_ACCESS_KEY=$AWS_SECRET_ACCESS_KEY
## Set the directory where you want to mount your s3 bucket
ARG S3_MOUNT_DIRECTORY=/var/www/s3
ENV S3_MOUNT_DIRECTORY=$S3_MOUNT_DIRECTORY
## Replace with your s3 bucket name
ARG S3_BUCKET_NAME=$S3_BUCKET_NAME
ENV S3_BUCKET_NAME=$S3_BUCKET_NAME
## Mount S3 bucket and create automatic mount script
RUN echo $AWS_ACCESS_KEY:$AWS_SECRET_ACCESS_KEY > /root/.passwd-s3fs && \
chmod 600 /root/.passwd-s3fs
## change workdir to /
WORKDIR /
## Entry Point
ADD start-script.sh /start-script.sh
RUN chmod 755 /start-script.sh
CMD ["/start-script.sh"]