dita-ot / dita-ot-action

GitHub Action for building PDFs and static websites using DITA Open Toolkit
https://www.dita-ot.org
Apache License 2.0
8 stars 4 forks source link

Docker build failed in dita-ot-action #2

Closed jiewang2 closed 3 years ago

jiewang2 commented 3 years ago

Expected Behavior

Docker build should pass.

Actual Behavior

Docker build failed at step 8.

Copy of the error message, log file or stack trace

Step 8/12 : RUN export DEBIAN_FRONTEND=noninteractive &&    ln -fs /usr/share/zoneinfo/America/New_York /etc/localtime &&     dpkg-reconfigure --frontend noninteractive locales tzdata &&  locale-gen en_US.UTF-8 &&     rm -rf /var/lib/apt/lists/* &&     chmod +x /entrypoint.sh &&     chmod +x /build_script.sh  &&   chmod +x /install_script.sh
139
   ---> Running in 6d94f3852fe7
140
  Generating locales (this might take a while)...
141
    en_US.UTF-8... done
142
  Generation complete.
143
  dpkg-query: package 'tzdata' is not installed and no information is available
144
  Use dpkg --info (= dpkg-deb --info) to examine archive files,
145
  and dpkg --contents (= dpkg-deb --contents) to list their contents.
146
  /usr/sbin/dpkg-reconfigure: tzdata is not installed
147
  The command '/bin/bash -o pipefail -c export DEBIAN_FRONTEND=noninteractive &&    ln -fs /usr/share/zoneinfo/America/New_York /etc/localtime &&     dpkg-reconfigure --frontend noninteractive locales tzdata &&  locale-gen en_US.UTF-8 &&     rm -rf /var/lib/apt/lists/* &&     chmod +x /entrypoint.sh &&     chmod +x /build_script.sh  &&   chmod +x /install_script.sh' returned a non-zero code: 1

Environment

The action yaml code:

name: CI
'on':
  push:
    branches:
      - gh-actions
jobs:
  build-dita:
    name: Build DITA
    runs-on: ubuntu-latest
    steps:
      - name: Git checkout
        uses: actions/checkout@v2
      - name: Build HTML
        uses: dita-ot/dita-ot-action@master
        with:
          input: cn/RTC/RTC_API_Windows.ditamap
          transtype: html5
          output-path: out
jason-fox commented 3 years ago

Does the updated Dockerfile now work for you?

jiewang2 commented 3 years ago

The build failed with a different error:

image
jason-fox commented 3 years ago

That must be to do with the permissions you have on your local PC. The Dockerfile is clearly running as ROOT:

https://github.com/dita-ot/dita-ot-action/blob/master/Dockerfile#L10

The GitHub Action is working on the GitHub's own infrastructure as can be seen on this test run here

2021-04-09T05:53:56.8706029Z Step 1/12 : FROM ghcr.io/dita-ot/dita-ot:3.6.1 AS DITA_OT
2021-04-09T05:53:57.6550449Z 3.6.1: Pulling from dita-ot/dita-ot
2021-04-09T05:54:03.8490397Z Digest: sha256:4ff3f3968744fcac57976e22a7b8e080d4e361547a57355747d02291672b1a27
2021-04-09T05:54:03.8504540Z Status: Downloaded newer image for ghcr.io/dita-ot/dita-ot:3.6.1
2021-04-09T05:54:03.8550845Z  ---> eacaea8c8267
2021-04-09T05:54:03.8551371Z Step 2/12 : SHELL ["/bin/bash", "-o", "pipefail", "-c"]
2021-04-09T05:54:05.8010039Z  ---> Running in f57eb59469a8
2021-04-09T05:54:06.1657034Z Removing intermediate container f57eb59469a8
2021-04-09T05:54:06.1719489Z  ---> 5f90510d33ad
2021-04-09T05:54:06.1719932Z Step 3/12 : USER root
2021-04-09T05:54:06.1960812Z  ---> Running in 6a2bd43d1aeb
2021-04-09T05:54:07.0238745Z Removing intermediate container 6a2bd43d1aeb
2021-04-09T05:54:07.0239288Z  ---> 689c84df184d
2021-04-09T05:54:07.0239669Z Step 4/12 : WORKDIR /
2021-04-09T05:54:07.0463027Z  ---> Running in 1612e588e1d7
2021-04-09T05:54:08.0302183Z Removing intermediate container 1612e588e1d7
2021-04-09T05:54:08.0302822Z  ---> 9faf54833bbc
2021-04-09T05:54:08.0303665Z Step 5/12 : COPY entrypoint.sh entrypoint.sh
2021-04-09T05:54:09.0241796Z  ---> 2c7baa7414ce
2021-04-09T05:54:09.0242654Z Step 6/12 : COPY script.sh install_script.sh
2021-04-09T05:54:10.0214254Z  ---> 3ec52a7b9d32
2021-04-09T05:54:10.0214782Z Step 7/12 : COPY script.sh build_script.sh
2021-04-09T05:54:11.0193417Z  ---> d514d01d8525
2021-04-09T05:54:11.0195185Z Step 8/12 : RUN export DEBIAN_FRONTEND=noninteractive &&   apt-get update &&   apt-get install --reinstall tzdata &&   ln -fs /usr/share/zoneinfo/America/New_York /etc/localtime &&   dpkg-reconfigure --frontend noninteractive locales tzdata &&    locale-gen en_US.UTF-8 &&   rm -rf /var/lib/apt/lists/* &&  chmod +x /entrypoint.sh &&  chmod +x /build_script.sh  &&   chmod +x /install_script.sh
2021-04-09T05:54:11.0443153Z  ---> Running in 104a867dbd3d
2021-04-09T05:54:11.6939944Z Get:1 http://security.ubuntu.com/ubuntu bionic-security InRelease [88.7 kB]
2021-04-09T05:54:11.7044970Z Get:2 http://archive.ubuntu.com/ubuntu bionic InRelease [242 kB]
2021-04-09T05:54:14.6068645Z Fetched 22.3 MB in 3s (7,047 kB/s)
2021-04-09T05:54:15.6580636Z Reading package lists...
2021-04-09T05:54:16.7990851Z Reading package lists...
2021-04-09T05:54:17.0295183Z Building dependency tree...
2021-04-09T05:54:17.0298083Z Reading state information...
2021-04-09T05:54:17.1789133Z The following NEW packages will be installed:
2021-04-09T05:54:17.1790133Z   tzdata
2021-04-09T05:54:17.4546303Z 0 upgraded, 1 newly installed, 0 to remove and 57 not upgraded.
2021-04-09T05:54:17.4546948Z Need to get 190 kB of archives.
2021-04-09T05:54:17.4547562Z After this operation, 3,109 kB of additional disk space will be used.
2021-04-09T05:54:17.4548779Z Get:1 http://archive.ubuntu.com/ubuntu bionic-updates/main amd64 tzdata all 2021a-0ubuntu0.18.04 [190 kB]
2021-04-09T05:54:17.9918898Z debconf: delaying package configuration, since apt-utils is not installed
2021-04-09T05:54:18.0125803Z Fetched 190 kB in 1s (275 kB/s)
2021-04-09T05:54:18.0394841Z Selecting previously unselected package tzdata.
2021-04-09T05:54:18.0458345Z (Reading database ... 5166 files and directories currently installed.)
2021-04-09T05:54:18.0459656Z Preparing to unpack .../tzdata_2021a-0ubuntu0.18.04_all.deb ...
2021-04-09T05:54:18.0471571Z Unpacking tzdata (2021a-0ubuntu0.18.04) ...
2021-04-09T05:54:18.2969724Z Setting up tzdata (2021a-0ubuntu0.18.04) ...
2021-04-09T05:54:18.3982820Z 
2021-04-09T05:54:18.3983542Z Current default time zone: 'Etc/UTC'
2021-04-09T05:54:18.4009841Z Local time is now:      Fri Apr  9 05:54:18 UTC 2021.
2021-04-09T05:54:18.4010393Z Universal Time is now:  Fri Apr  9 05:54:18 UTC 2021.
2021-04-09T05:54:18.4011263Z Run 'dpkg-reconfigure tzdata' if you wish to change it.
2021-04-09T05:54:18.4014630Z 
2021-04-09T05:54:19.0825678Z Generating locales (this might take a while)...
2021-04-09T05:54:19.8167249Z   en_US.UTF-8... done
2021-04-09T05:54:19.8174519Z Generation complete.
2021-04-09T05:54:19.8867926Z 
2021-04-09T05:54:19.8869462Z Current default time zone: 'America/New_York'
2021-04-09T05:54:19.8890879Z Local time is now:      Fri Apr  9 01:54:19 EDT 2021.
2021-04-09T05:54:19.8891449Z Universal Time is now:  Fri Apr  9 05:54:19 UTC 2021.
2021-04-09T05:54:19.8892032Z 
2021-04-09T05:54:19.9136732Z Generating locales (this might take a while)...
2021-04-09T05:54:20.6366141Z   en_US.UTF-8... done
2021-04-09T05:54:20.6369546Z Generation complete.
2021-04-09T05:54:21.4580507Z Removing intermediate container 104a867dbd3d
2021-04-09T05:54:21.4581021Z  ---> 961aa0a6a294
2021-04-09T05:54:21.4581422Z Step 9/12 : ENV LANG en_US.UTF-8
2021-04-09T05:54:21.4792293Z  ---> Running in ecd7c2f71e19
2021-04-09T05:54:22.0242634Z Removing intermediate container ecd7c2f71e19
2021-04-09T05:54:22.0243197Z  ---> 14a3290fca73
2021-04-09T05:54:22.0243608Z Step 10/12 : ENV LANGUAGE en_US:en
2021-04-09T05:54:22.0461562Z  ---> Running in eee6b4359c5c
2021-04-09T05:54:23.0276030Z Removing intermediate container eee6b4359c5c
2021-04-09T05:54:23.0276591Z  ---> be9dc70959d3
2021-04-09T05:54:23.0277024Z Step 11/12 : ENV LC_ALL en_US.UTF-8
2021-04-09T05:54:23.0525902Z  ---> Running in bfd93b0fd35b
2021-04-09T05:54:24.0242179Z Removing intermediate container bfd93b0fd35b
2021-04-09T05:54:24.0242746Z  ---> 6ab01e3512b2
2021-04-09T05:54:24.0243172Z Step 12/12 : ENTRYPOINT ["/entrypoint.sh"]
2021-04-09T05:54:24.0563015Z  ---> Running in 5a98d70636e3
2021-04-09T05:54:25.0244124Z Removing intermediate container 5a98d70636e3
2021-04-09T05:54:25.0246608Z  ---> 6606e59a6e27
2021-04-09T05:54:25.0247740Z Successfully built 6606e59a6e27
2021-04-09T05:54:25.0279830Z Successfully tagged 5588e4:09f32c66cf0f4ee0adcc1944ee69b07a
2021-04-09T05:54:25.0319493Z ##[endgroup]

Can you share your GitHub workflow (or replace it with this) to see if that is causing your error.

jiewang2 commented 3 years ago

Sorry, I forgot to delete a test command. It works now, cheers!