docker - Docker:设备上没有剩余空间

标签 docker db2 dockerfile yum

我已经在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 system prune吗?这将删除所有未使用的容器。请谨慎使用。

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

关于docker - Docker:设备上没有剩余空间,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/55861292/

相关文章:

docker - Openshift oc new-app命令getsockopt:连接被拒绝错误

docker - 如何在不运行的情况下从 docker build 复制结果

db2 - 如何从DB2撤消Windows Administrator用户的许可?

docker - 安装 davfs2 卷时无法在 docker 容器中打开 fuse 设备

linux - Dockerfile CMD `command not found`

node.js - Heroku找不到Playwright文件

docker - 在容器构建过程中如何将主机OS文件映射到容器

sql - DB2 将一个值增加一定数量

c++ - 仅使用 libdb2 解析 xml 时的段错误

当本地存在镜像时,Docker 尝试从 dockerhub 拉取不存在的镜像