oracle / docker-images

Official source of container configurations, images, and examples for Oracle products and projects
https://developer.oracle.com/use-cases/#containers
Universal Permissive License v1.0
6.58k stars 5.43k forks source link

build fail "checkSpace.sh: ERROR" #781

Closed liuxi653 closed 6 years ago

liuxi653 commented 6 years ago

description when run cmd "./buildDockerImage.sh -v 12.2.0.1 -s -i" ,return below wrong info.

!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
checkSpace.sh: ERROR - There is not enough space available in the docker container.
checkSpace.sh: The container needs at least 15 GB, but only 6 GB are available.
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

analysis check the script below,found "df" also lead a line showing problem docker-images/OracleDatabase/dockerfiles/12.1.0.2/checkSpace.sh

************
REQUIRED_SPACE_GB=12
AVAILABLE_SPACE_GB=`df -B 1G / | tail -n 1 | awk '{ print $4 }'`
************

like this,Filesystem name is too long to be a line showing with the other item

[root@localhost dockerfiles]# df -B 1G
Filesystem           1G-blocks  Used Available Use% Mounted on
/dev/mapper/VolGroup-lv_root
                            50    14        34  28% /
tmpfs                       32     0        32   0% /dev/shm
/dev/sda1                    1     1         1  19% /boot
/dev/mapper/VolGroup-lv_home
                         10922     4     10364   1% /home
[root@localhost dockerfiles]#

Solution: use option -P

[root@localhost dockerfiles]# df -PB 1G
Filesystem                   1073741824-blocks  Used Available Capacity Mounted on
/dev/mapper/VolGroup-lv_root                50    14        34      28% /
tmpfs                                       32     0        32       0% /dev/shm
/dev/sda1                                    1     1         1      19% /boot
/dev/mapper/VolGroup-lv_home             10922     4     10364       1% /home
[root@localhost dockerfiles]#

note also the scripts under dir " 11.2.0.2 12.1.0.2 " may have the same problem

cruepprich commented 6 years ago

I have the same problem. Unfortunately, this didn't work for me. I tried expanding the Docker base image size as per #565 , but had no luck either.

I was able to change the base size to 20G by creating the file /etc/docker/daemon.json and adding the following JSON:

{
  "storage-opts": ["dm.basesize=20G"]
}

Storage Driver: devicemapper Pool Name: docker-8:17-2883586-pool Pool Blocksize: 65.54kB Base Device Size: 21.47GB

Unfortunately, that didn't fix the problem. I still get the error:

!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
checkSpace.sh: ERROR - There is not enough space available in the docker container.
checkSpace.sh: The container needs at least 15 GB, but only 6 GB are available.
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

I wonder if this is a problem (on host):

df -h
tmpfs           5.5G     0  5.5G   0% /run/user/1000

FYI: I'm working on an OCI Compute instance running Oracle Linux Server release 7.4.

gvenzl commented 6 years ago

@liuxi653, thanks for spotting this!

@cruepprich, are you sure that you dropped all images after changing that parameter and restarting Docker? If you don't this won't take effect for the already existing base images.

cruepprich commented 6 years ago

@gvenzl Thanks for the quick reply. I went ahead and cleaned house, since I had some other images. After that I got past the checkSpace.sh issue, but then I ran into another one. I'll open a ticket for it.

Cheers, C

$ docker system prune -f --volumes
...
deleted: sha256:0b317ec81f9ccfbf38b13ae36569df19a630db7b4cf4ef1fae57b1e36d7545ee

Total reclaimed space: 3.454GB

$ docker system info | grep Base
Base Device Size: 21.47GB

$ docker system df
TYPE                TOTAL               ACTIVE              SIZE                RECLAIMABLE
Images              0                   0                   0B                  0B
Containers          0                   0                   0B                  0B
Local Volumes       0                   0                   0B                  0B
Build Cache                                                 0B                  0B

$ sudo systemctl stop docker
$ sudo systemctl start docker

$ cd /u01/git/docker-images/OracleDatabase/dockerfiles

$ ./buildDockerImage.sh -v 12.2.0.1 -e

...more output...
Step 7/17 : RUN chmod ug+x $INSTALL_DIR/*.sh &&     sync &&     $INSTALL_DIR/$CHECK_SPACE_FILE &&     $INSTALL_DIR/$SETUP_LINUX_FILE
 ---> Running in ef572a4aab6d
Loaded plugins: ovl
http://yum.oracle.com/repo/OracleLinux/OL7/latest/x86_64/repodata/primary.xml.gz: [Errno -1] Metadata file does not match checksum
Trying other mirror.
http://yum.oracle.com/repo/OracleLinux/OL7/latest/x86_64/repodata/primary.xml.gz: [Errno -1] Metadata file does not match checksum
Trying other mirror.
Djelibeybi commented 6 years ago

@cruepprich don't open an issue: it's a transient yum.oracle.com issue (that is being actively worked already). Try again in 15 minutes, please.

cruepprich commented 6 years ago

Oops. Too late. I had opened the issue but closed it just now.

Thanks.

gvenzl commented 6 years ago

Fixed! Thanks a lot again, everybody!

alanamircruz commented 4 years ago

Due to a lack of space in root directory '/' and if somebody finds it useful. I did this to fix it:

  1. Change the daemon.json from docker in order to use a customized location for docker service.

    {
    "data-root":"/data/var/lib/docker"
    }
  2. Restart the docker service.

  3. Then modify the checkSpace script for the intended Oracle DB version to be build (-v 18.0.4 -x) image

  4. Finally update the required or specific Dockerfile.xe in order to change the $HOME value into your custom directory. image

FELICIOMARINHO commented 3 years ago

I had this problem today. What did I do. In the first attempt to overcome this problem I changed the script that validates the space "checkSpace.sh", I pointed to my FileSysten where it contains a lot of space. It looks like this: df -PB 1G / DockerStorage | tail -n 1 | awk '{print $ 4}.

It was even quiet, it worked normally, but I noticed that really what was being used by the system was another way to consume the spaces that was: / dev / mapper / centos-root.

With that, I added one more disk and applied it to the CENTOS group, then did a resize / dev / mapper / centos-root.

I hope I had the opportunity to collaborate in solving this problem.

Luiz Marinho LVM_PV_RESIZE