gpt4 book ai didi

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

转载 作者:行者123 更新时间:2023-12-02 21:09:16 25 4
gpt4 key购买 nike

我已经在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/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com