Docker:设备上没有剩余空间

问题描述 投票:0回答:1

我在docker上安装了DB2。它工作正常。我已经使用docker文件多次删除并重新创建了图像。但是这次当我试图重新创建图像时,我收到了以下错误。

Error processing tar file(exit status 1): write /tmp/server_dec/db2/linuxamd64/tsamp/Linux/i386/sam.adapter-4.1.0.4-18088.i386.rpm: no space left on device

我猜有些文件夹已满,我需要删除一些东西,但我不知道是什么。

以下是我的Dockerfile:

 ## Purpose: Build Docker Image of DB2 Developer C v11.1.3.3.
 ##
 ## Will need to run in privleged mode for DB2START to work.
 ##
 ## Download:  IBM DB2 v11.1.3.3 (v11.1_linuxx64_dec.tar.gz)
 ##
 ## Prerequisite:
 ## Much will be done for you in this build, but you will still need to
 ## Download the installation binaries.
 ##
 ## Build:
 ##   docker build  --squash --build-arg <Corporate Proxies> -t "db2devc:v11.1.3.3" .
 ##
 ## Execution:
 ##   Set a password for db2inst1 and dbuser
 ##   docker run --privileged -e DBNAME='<database name>' -e DB2_PASS='<password>' -e USER_PASS='password' -d <image_name>
 ##
 ## Get to Shell after container start:
 ##   docker exec -it <container_name> /bin/bash


 FROM centos:7

 #####################################################################
 ##           System Preparation and DB2 Pre-Requisites             ##
 #####################################################################

 RUN yum install -y \
   pam-devel \
   pam.i686 \
   libaio \
   libstdc++-devel.i686 \
   numactl-libs \
   gcc \
   gcc-c++ \
   ksh \
   numactl \
   file \
   kernel-devel \
   vi \
   sudo \
   util-linux \
   which \
   openssh-clients \
   zip \
   unzip \
   && yum clean all


 #####################################################################
 ##                       Install DB2                               ##
 #####################################################################

 ## Pull TAR file with DB2 Binaries, extract, install, license, remove tar file
 COPY ./v11.1_linuxx64_dec.tar.gz /tmp/v11.1_linuxx64_dec.tar.gz


 RUN cd /tmp && tar -xvf v11.1_linuxx64_dec.tar.gz \
&& /bin/sh -c "/tmp/server_dec/db2_install -y -b /opt/ibm/db2/V11.1 -p server -n" 2>&1 > /tmp/DB2_DOCKER_INSTALL.log || echo "Installed with acceptable error."

 RUN rm -rf /tmp/v11.1_linuxx64_dec.tar.gz


 #####################################################################
 ##                       Core & Maint Filesystems                  ##
 #####################################################################

 ## Create Filesystems (Environment Preparation)
 ##    Need to create first so we can change ownership, then VOLUME      will provide permanency.
 ##    If declare VOLUME first, will not take permission/ownership changes.

 RUN mkdir -p /home/db2inst1 /data /db_logs /db_backup /sw/db2diag

 #####################################################################
 ##                    Filesystem Persistance                       ##
 #####################################################################


 ## Mount Filesystems (Environment Preparation)
 ## Note: Creates permancy outside container
 ##       In Centos:7, df -h will only show one filesystem mounted although
 ##       things show properly mounted with "mount".  Centos:6, df -h appears correctly.

 VOLUME /opt
 VOLUME /home/db2inst1
 VOLUME /data
 VOLUME /db_logs
 VOLUME /db_backup
 VOLUME /db2diag

 #####################################################################
 ##                       Open Port                                 ##
 #####################################################################
 EXPOSE 50000

 #####################################################################
 ##                       ENTRYPOINT                                ##
 #####################################################################

 COPY ./Env_Script.sh /tmp/Env_Script.sh
 COPY ./DB_BUILD.ksh /tmp/DB_BUILD.ksh
 RUN chmod +x /tmp/Env_Script.sh
 RUN chmod +x /tmp/DB_BUILD.ksh
 ENTRYPOINT ["/tmp/Env_Script.sh"]

我在互联网上得到了类似的东西,但那些没有用。任何帮助表示赞赏。

docker db2 dockerfile yum
1个回答
1
投票

试试docker system prune?这将删除所有未使用的容器。请谨慎使用。

文件:https://docs.docker.com/engine/reference/commandline/system_prune/

© www.soinside.com 2019 - 2024. All rights reserved.