github.com/rohankumardubey/proxyfs@v0.0.0-20210108201508-653efa9ab00e/saio/container/Dockerfile (about)

     1  FROM centos:7.4.1708
     2  
     3  ARG SwiftVersion=ss-release-2.26.0.1
     4  ARG GolangVersion=1.13.6
     5  ARG ProxyFS_Version=stable
     6  
     7  ENV GolangBasename "go${GolangVersion}.linux-amd64.tar.gz"
     8  ENV GolangURL      "https://golang.org/dl/${GolangBasename}"
     9  
    10  RUN yum install -y yum-utils
    11  
    12  RUN yum-config-manager --disable CentOS-Base
    13  RUN yum-config-manager --disable CentOS-CR
    14  RUN yum-config-manager --disable CentOS-Debuginfo
    15  RUN yum-config-manager --disable CentOS-fasttrack
    16  RUN yum-config-manager --disable CentOS-Media
    17  RUN yum-config-manager --disable CentOS-Sources
    18  RUN yum-config-manager --disable CentOS-Vault
    19  
    20  RUN rm -rf /etc/yum.repos.d/CentOS-Base.repo
    21  RUN rm -rf /etc/yum.repos.d/CentOS-CR.repo
    22  RUN rm -rf /etc/yum.repos.d/CentOS-Debuginfo.repo
    23  RUN rm -rf /etc/yum.repos.d/CentOS-fasttrack.repo
    24  RUN rm -rf /etc/yum.repos.d/CentOS-Media.repo
    25  RUN rm -rf /etc/yum.repos.d/CentOS-Sources.repo
    26  RUN rm -rf /etc/yum.repos.d/CentOS-Vault.repo
    27  
    28  RUN yum-config-manager --add-repo http://vault.centos.org/centos/7.4.1708/os/x86_64/
    29  RUN yum-config-manager --add-repo http://vault.centos.org/centos/7.4.1708/updates/x86_64/
    30  RUN yum-config-manager --add-repo http://vault.centos.org/centos/7.4.1708/extras/x86_64/
    31  RUN yum-config-manager --add-repo http://vault.centos.org/centos/7.4.1708/centosplus/x86_64/
    32  RUN yum-config-manager --enable vault.centos.org_centos_7.4.1708_os_x86_64_
    33  RUN yum-config-manager --enable vault.centos.org_centos_7.4.1708_updates_x86_64_
    34  RUN yum-config-manager --enable vault.centos.org_centos_7.4.1708_extras_x86_64_
    35  RUN yum-config-manager --enable vault.centos.org_centos_7.4.1708_centosplus_x86_64_
    36  
    37  RUN yum clean all
    38  
    39  RUN yum install -y wget
    40  RUN yum install -y git
    41  
    42  RUN yum install -y --disableexcludes=all glibc-common gcc
    43  
    44  RUN useradd --user-group --groups wheel swift
    45  RUN chmod 755 ~swift
    46  
    47  RUN yum install -y attr
    48  RUN yum install -y e2fsprogs
    49  
    50  RUN mkdir -p /srv
    51  RUN truncate -s 1GB /srv/swift-disk
    52  RUN echo "y" | mkfs.ext4 -I 4096 /srv/swift-disk
    53  RUN mkdir -p /srv/1/node/sdb1
    54  RUN echo "/srv/swift-disk /srv/1/node/sdb1 ext4 loop,noatime,nodiratime,nobarrier 0 0" >> /etc/fstab
    55  
    56  RUN mkdir -p /var/cache/swift /var/cache/swift2 /var/cache/swift3 /var/cache/swift4
    57  RUN chown swift:swift /var/cache/swift*
    58  RUN mkdir -p /var/run/swift
    59  RUN chown swift:swift /var/run/swift
    60  
    61  RUN yum install -y \
    62      memcached \
    63      sqlite \
    64      xfsprogs \
    65      libffi-devel \
    66      xinetd \
    67      openssl-devel \
    68      python-setuptools \
    69      python-coverage \
    70      python-devel \
    71      python-nose \
    72      pyxattr \
    73      python-eventlet \
    74      python-greenlet \
    75      python-paste-deploy \
    76      python-netifaces \
    77      python-dns \
    78      python-mock
    79  
    80  RUN yum install -y centos-release-scl
    81  RUN yum install -y rh-python36
    82  RUN ln -s /opt/rh/rh-python36/root/bin/python3.6 /bin/python3.6
    83  RUN ln -s /bin/python3.6 /bin/python3
    84  RUN ln -s /opt/rh/rh-python36/root/usr/include /opt/rh/rh-python36/root/include
    85  
    86  RUN yum install -y epel-release
    87  RUN yum install -y python-pip
    88  RUN pip install --upgrade pip
    89  RUN pip install --upgrade setuptools
    90  
    91  WORKDIR ~swift
    92  RUN git clone https://github.com/openstack/liberasurecode.git
    93  WORKDIR liberasurecode
    94  RUN yum install -y gcc make autoconf automake libtool
    95  RUN ./autogen.sh
    96  RUN ./configure
    97  RUN make
    98  RUN make install
    99  RUN echo "/usr/local/lib" > /etc/ld.so.conf.d/liberasurecode.conf
   100  RUN ldconfig
   101  
   102  WORKDIR ~swift
   103  RUN git clone https://github.com/openstack/pyeclib.git
   104  WORKDIR pyeclib
   105  RUN pip install -e .
   106  RUN pip install -r test-requirements.txt
   107  
   108  WORKDIR ~swift
   109  RUN git clone https://github.com/swiftstack/swift.git
   110  WORKDIR swift
   111  RUN git checkout $SwiftVersion
   112  RUN pip install wheel
   113  RUN python setup.py bdist_wheel
   114  RUN pip install --no-binary cryptography -r requirements.txt
   115  RUN python setup.py develop
   116  RUN pip install python-openstackclient==3.12.0 python-glanceclient==2.7.0
   117  RUN pip install -r test-requirements.txt
   118  
   119  # TODO: May need to do something about:
   120  #   systemctl enable memcached.service
   121  #   systemctl start memcached.service
   122  
   123  WORKDIR /etc/swift
   124  
   125  RUN rm -f *.builder *.ring.gz backups/*.builder backups/*.ring.gz
   126  RUN swift-ring-builder object.builder create 10 1 1
   127  RUN swift-ring-builder object.builder add r1z1-127.0.0.1:8010/sdb1 1
   128  RUN swift-ring-builder object.builder rebalance
   129  RUN swift-ring-builder object-1.builder create 10 1 1
   130  RUN swift-ring-builder object-1.builder add r1z1-127.0.0.1:8010/sdb1 1
   131  RUN swift-ring-builder object-1.builder rebalance
   132  RUN swift-ring-builder object-2.builder create 10 1 1
   133  RUN swift-ring-builder object-2.builder add r1z1-127.0.0.1:8010/sdb1 1
   134  RUN swift-ring-builder object-2.builder rebalance
   135  RUN swift-ring-builder container.builder create 10 1 1
   136  RUN swift-ring-builder container.builder add r1z1-127.0.0.1:8011/sdb1 1
   137  RUN swift-ring-builder container.builder rebalance
   138  RUN swift-ring-builder account.builder create 10 1 1
   139  RUN swift-ring-builder account.builder add r1z1-127.0.0.1:8012/sdb1 1
   140  RUN swift-ring-builder account.builder rebalance
   141  
   142  COPY etc/swift .
   143  RUN chown -R swift:swift .
   144  
   145  WORKDIR /opt/ProxyFS
   146  
   147  COPY pfs_middleware  pfs_middleware
   148  COPY meta_middleware meta_middleware
   149  
   150  RUN cd pfs_middleware  && python setup.py develop
   151  RUN cd meta_middleware && python setup.py develop
   152  
   153  RUN rm -rf /var/log/proxyfsd
   154  RUN mkdir -p /var/log/proxyfsd
   155  RUN touch /var/log/proxyfsd/proxyfsd.log
   156  RUN chmod 777 /var
   157  RUN chmod 777 /var/log
   158  RUN chmod 777 /var/log/proxyfsd
   159  RUN chmod 666 /var/log/proxyfsd/proxyfsd.log
   160  
   161  WORKDIR /opt/ProxyFS
   162  RUN wget -nv $GolangURL
   163  RUN tar -C /usr/local -xzf $GolangBasename
   164  
   165  ENV GOPATH /opt/ProxyFS/GOPATH
   166  ENV PATH   $PATH:/usr/local/go/bin:$GOPATH/bin
   167  
   168  RUN yum install -y make fuse
   169  
   170  RUN mkdir -p $GOPATH/src/github.com/swiftstack
   171  WORKDIR $GOPATH/src/github.com/swiftstack
   172  RUN git clone https://github.com/swiftstack/ProxyFS.git
   173  WORKDIR $GOPATH/src/github.com/swiftstack/ProxyFS
   174  RUN git checkout $ProxyFS_Version
   175  
   176  RUN make version pre-generate generate install
   177  
   178  WORKDIR /opt/ProxyFS
   179  
   180  RUN mkdir     CommonMountPoint
   181  RUN chmod 777 CommonMountPoint
   182  
   183  RUN yum install -y rsyslog
   184  RUN echo "\$ModLoad imudp" >> /etc/rsyslog.conf
   185  RUN echo "\$UDPServerRun 514" >> /etc/rsyslog.conf
   186  
   187  COPY docker_startup.sh .
   188  COPY proxyfs.conf .
   189  RUN chmod +x docker_startup.sh
   190  
   191  CMD /opt/ProxyFS/docker_startup.sh
   192  
   193  # To build this image:
   194  #
   195  #   docker build \
   196  #          [--build-arg SwiftVersion=<branch-name-or-tag-or-SHA]     \
   197  #          [--build-arg GolangVersion=<major#.minor#[.patch#]>]      \
   198  #          [--build-arg ProxyFS_Version=<branch-name-or-tag-or-SHA>] \
   199  #          [-t <repository>:<tag>]                                   .
   200  
   201  # To run a container for this image:
   202  #
   203  #   docker run -it --rm --device /dev/fuse --device /dev/loop0 --cap-add SYS_ADMIN -p 15346:15346 saio-pfs