docker - Docker:设备上没有剩余空间
问题描述
我已经在 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/
推荐阅读
- javascript - 试图让 HTML Radio 触发显示图像的功能
- python - 有什么方法可以在不使用私有函数的情况下将 pandas DataFrame itertuples 对象转换为字典?
- git - 当远程仓库发生变化时自动同步本地仓库
- boto - 使用 s3fs 将 sklearn 模型上传到 S3 存储桶时出现问题
- java - 无法为 Apache Commons-csv 添加 Maven 依赖项
- spring-boot - 为什么 CascadeType.MERGE、CascadeType.PERSIST 无助于获取内部数据
- javascript - 使用 javascript 中的此选择器从很多特定对象中制作动画
- vb.net - 单元格未更新 - VB.net,oledb
- javascript - 如何处理导致 React 应用程序延迟的大型原始图像重新渲染?
- vb.net - 如何将位图转换为 mat VB.net