Can not rename/delete files while building image on CoreOS

82 views
Skip to first unread message

Sergey Esin

unread,
Jun 6, 2016, 12:30:17 PM6/6/16
to CoreOS User
Hi all,

I am getting very strange issue with:

# cat /etc/os-release
NAME=CoreOS
ID=coreos
VERSION=766.3.0
VERSION_ID=766.3.0
BUILD_ID=
PRETTY_NAME="CoreOS 766.3.0"
ANSI_COLOR="1;32"



Here's my very simple Dockerfile (installing Java and timezone update):


# cat Dockerfile
FROM centos:6

RUN yum install -y unzip wget

ENV oracle_jdk_download_dir '/java64'
ENV oracle_jdk_package 'jdk-7u51-linux-x64.tar.gz'
ENV oracle_jdk_package_subdir '7u51-b13'
ENV oracle_jdk_unpacked_dirname 'jdk1.7.0_51'

RUN mkdir ${oracle_jdk_download_dir} > /dev/null 2>&1 || cd ${oracle_jdk_download_dir};  wget -N -P ${oracle_jdk_download_dir} --no-check-certificate --no-cookies --header "Cookie: oraclelicense=accept-securebackup-cookie" http://download.oracle.com/otn-pub/java/jdk/${oracle_jdk_package_subdir}/${oracle_jdk_package} > /dev/null 2>&1

RUN cd ${oracle_jdk_download_dir}; tar -xzf ${oracle_jdk_package}; rm -f current; ln -s ${oracle_jdk_unpacked_dirname} current; chown -R root:root ${oracle_jdk_download_dir} && chmod -R a+rwX ${oracle_jdk_download_dir}

ENV TZUPDATER_VERSION_UNDERSCORES 2_0_3
ENV TZUPDATER_VERSION_DOTS 2.0.3
ENV TZUPDATER_POSTFIX 2015b
ENV JAVA_HOME ${oracle_jdk_download_dir}/current

    unzip tzupdater-${TZUPDATER_VERSION_UNDERSCORES}-${TZUPDATER_POSTFIX}.zip && mv tzupdater-${TZUPDATER_VERSION_DOTS}-${TZUPDATER_POSTFIX}/tzupdater.jar /

RUN cd ${JAVA_HOME}/jre/bin/; ${JAVA_HOME}/bin/java -jar /tzupdater.jar -u -v && rm -rf /tzupdater-${TZUPDATER_VERSION_UNDERSCORES}-${TZUPDATER_POSTFIX}.zip tzupdater-${TZUPDATER_VERSION_UNDERSCORES}-${TZUPDATER_POSTFIX} /tzupdater.jar || /bin/true

RUN false



The problem is that I can successfully build this Dockefile on any other machine with Centos6 (like host OS), but can not build the same Dockerfile on CoreOS, it fails with following:

Step 14 : RUN cd ${JAVA_HOME}/jre/bin/; ${JAVA_HOME}/bin/java -jar /tzupdater.jar -u -v && rm -rf /tzupdater-${TZUPDATER_VERSION_UNDERSCORES}-${TZUPDATER_POSTFIX}.zip tzupdater-${TZUPDATER_VERSION_UNDERSCORES}-${TZUPDATER_POSTFIX} /tzupdater.jar || /bin/true
 ---> Running in e043a0cca40a
java.home: /usr1/java64/jdk1.7.0_51/jre
java.vendor: Oracle Corporation
java.version: 1.7.0_51
JRE tzdata version: tzdata2013h
tzupdater tool would update with tzdata version: tzdata2015b
Extracting files... done.
Renaming /usr1/java64/jdk1.7.0_51/jre/lib/zi to /usr1/java64/jdk1.7.0_51/jre/lib/zi.tzdata2013h
failed.
Cant rename {0} to {1}.
Exception in thread "main" com.sun.tools.tzupdater.TzRuntimeException: com.sun.tools.tzupdater.TzRuntimeException: Cant rename {0} to {1}.
        at com.sun.tools.tzupdater.TimezoneUpdater.main(TimezoneUpdater.java:799)
Caused by: com.sun.tools.tzupdater.TzRuntimeException: Cant rename {0} to {1}.
        at com.sun.tools.tzupdater.TimezoneUpdater.update(TimezoneUpdater.java:332)
        at com.sun.tools.tzupdater.TimezoneUpdater.run(TimezoneUpdater.java:272)
        at com.sun.tools.tzupdater.TimezoneUpdater.main(TimezoneUpdater.java:780)
 ---> 23fd98ab71fe
Removing intermediate container e043a0cca40a
Step 15 : RUN false
 ---> Running in f8773924afbc
The command '/bin/sh -c false' returned a non-zero code: 1



If I run base images like docker run --rm -it centos:6 bash and then start putting lines from the Dockerfile above one by one - it all goes fine.


Could you please point me into right direction?

Regards,
Sergey

Sergey Esin

unread,
Jun 6, 2016, 12:32:41 PM6/6/16
to CoreOS User
Quick update:

oracle_jdk_download_dir  is /usr1/java64 like in the failty "Step 14" (sorry for copy-paste from the wrong console)

Alex Crawford

unread,
Jun 8, 2016, 12:56:57 PM6/8/16
to Sergey Esin, CoreOS User
On 06/06, Sergey Esin wrote:
> If I run base images like docker run --rm -it centos:6 bash and then start
> putting lines from the Dockerfile above one by one - it all goes fine.
>
>
> Could you please point me into right direction?

This might an odd interaction between Docker and OverlayFS. You can try
using btrfs to see if it's successful. The instructions can be found in
our docs [1].

-Alex

[1]: https://coreos.com/os/docs/latest/mounting-storage.html#creating-and-mounting-a-btrfs-volume-file
signature.asc
Reply all
Reply to author
Forward
0 new messages