Docker is hung when installing packages.

108 views
Skip to first unread message

Toan Huynh Van

unread,
Feb 5, 2020, 9:18:56 PM2/5/20
to docker-dev
Hi all, 

I'm running packer to build docker image and Ansible as provisioner but Docker image is hung at step installing packages by using Ansible provisioner. Could you help me find a solution for this? 

Below is log messages:

docker:     "stderr_lines": [
    docker:         "",
    docker:         "Extracting templates from packages: 5%",
    docker:         "Extracting templates from packages: 10%",
    docker:         "Extracting templates from packages: 16%",
    docker:         "Extracting templates from packages: 21%",
    docker:         "Extracting templates from packages: 27%",
    docker:         "Extracting templates from packages: 32%",
    docker:         "Extracting templates from packages: 37%",
    docker:         "Extracting templates from packages: 43%",
    docker:         "Extracting templates from packages: 48%",
    docker:         "Extracting templates from packages: 54%",
    docker:         "Extracting templates from packages: 59%",
    docker:         "Extracting templates from packages: 64%",
    docker:         "Extracting templates from packages: 70%",
    docker:         "Extracting templates from packages: 75%",
    docker:         "Extracting templates from packages: 81%",
    docker:         "Extracting templates from packages: 86%",
    docker:         "Extracting templates from packages: 91%",
    docker:         "Extracting templates from packages: 97%",
    docker:         "Extracting templates from packages: 100%",
    docker:         "",
    docker:         "Current default time zone: 'Etc/UTC'",
    docker:         "Local time is now:      Wed Feb  5 09:02:44 UTC 2020.",
    docker:         "Universal Time is now:  Wed Feb  5 09:02:44 UTC 2020.",
    docker:         "Run 'dpkg-reconfigure tzdata' if you wish to change it.",
    docker:         "",
    docker:         "invoke-rc.d: policy-rc.d denied execution of start.",
    docker:         "Building database of manual pages ...",
    docker:         "update-initramfs: deferring update (trigger activated)",
    docker:         "invoke-rc.d: policy-rc.d denied execution of start.",
    docker:         "",
    docker:         "Creating config file /etc/gconf/2/path with new version",
    docker:         "invoke-rc.d: policy-rc.d denied execution of start.",
    docker:         "invoke-rc.d: policy-rc.d denied execution of start.",
    docker:         "invoke-rc.d: policy-rc.d denied execution of start.",
    docker:         "invoke-rc.d: policy-rc.d denied execution of start.",
    docker:         "invoke-rc.d: policy-rc.d denied execution of start.",
    docker:         "invoke-rc.d: unknown initscript, /etc/init.d/cgroup-lite not found.",
    docker:         "invoke-rc.d: policy-rc.d denied execution of start.",
    docker:         "invoke-rc.d: policy-rc.d denied execution of start.",
    docker:         "update-rc.d: warning: default stop runlevel arguments (0 1 6) do not match saslauthd Default-Stop values (1)",
    docker:         "invoke-rc.d: policy-rc.d denied execution of start.",
    docker:         "update-rc.d: warning:  stop runlevel arguments (1) do not match snmpd Default-Stop values (0 1 6)",
    docker:         "invoke-rc.d: policy-rc.d denied execution of start.",
    docker:         "",
    docker:         "Creating config file /etc/default/sysstat with new version",
    docker:         "update-alternatives: using /usr/bin/sar.sysstat to provide /usr/bin/sar (sar) in auto mode",
    docker:         "invoke-rc.d: policy-rc.d denied execution of start.",
    docker:         "invoke-rc.d: unknown initscript, /etc/init.d/systemd-logind not found.",
    docker:         "invoke-rc.d: policy-rc.d denied execution of start.",
    docker:         "invoke-rc.d: policy-rc.d denied execution of start.",
    docker:         "",
    docker:         "(gconftool-2:8576): GConf-WARNING **: Client failed to connect to the D-BUS daemon:",
    docker:         "Unable to autolaunch a dbus-daemon without a $DISPLAY for X11",
    docker:         "invoke-rc.d: policy-rc.d denied execution of start.",
    docker:         "invoke-rc.d: policy-rc.d denied execution of start.",
    docker:         "invoke-rc.d: policy-rc.d denied execution of start."
    docker:     ],

Thanks 

manoj kavali

unread,
Feb 5, 2020, 9:32:43 PM2/5/20
to Toan Huynh Van, docker-dev
Hi Toan,
                    I have quick question what type of templates or packaging you are using for Docker ?

Thanks
Manoj

--
You received this message because you are subscribed to the Google Groups "docker-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to docker-dev+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/docker-dev/14c64553-856b-4d3e-84c5-098fe1fcc479%40googlegroups.com.

Toan Huynh Van

unread,
Feb 5, 2020, 9:42:54 PM2/5/20
to docker-dev
Hi Manoj,
          
              I have a a lot of packages need to install in docker image. So I put it into a file and use apt module in ansible to install. You can see my playbook as below:

I stuck at step "# Install preconfigured Debian packages" 

---
- hosts: all
  become: yes
  gather_facts: no
  tasks:
  - name: Hello world
    shell: "echo 'Hello world'"
  - name: Update OS
    command: apt update

#Basic tools
  - name: Install git, zip, unzip, curl, wget, dos2unix, jq
    apt: 
      name: ['git', 'zip' ,'unzip', 'curl', 'wget', 'dos2unix', 'jq']
      state: present
      update_cache: yes
  - name: Install essential tools
    apt:
      name: ['build-essential', 'libcurl4-openssl-dev', 'libxml2-dev', 'mime-support', 'automake', 'libtool', 'software-properties-common']
      state: present
      update_cache: yes
#Python
  - name: Boostrap python
    raw: test -e /usr/bin/python || (apt-get -y update && apt-get install -y python-dev)
  - name: Install pip
    apt:
      name: python-pip
      state: present
      update_cache: yes
  - name: Update pip
    pip:
      name: pip==9.0.3
#Java 
  - name: Add Java 8 repository
    apt_repository: 
      repo: ppa:webupd8team/java
      state: present
      validate_certs: no
      update_cache: yes
  - name: Remove old java versions
    apt:
      name: ['openjdk-7-jdk', 'openjdk-7-jre', 'openjdk-7-jre-headless']
      state: absent
      update_cache: yes
  - name: Edit environment file
    lineinfile:
      path: /etc/environment
      line: JAVA_HOME="/usr/lib/jvm/java-7-oracle/jre/bin/java"
#NodeJS
  - name: Add nodeJS LTS repo
    shell: curl -sL https://deb.nodesource.com/setup_10.x | sudo -E bash -
  - name: Install nodejs
    apt:
      name: nodejs
      state: present
      update_cache: yes
  - name: Update npm
    shell: npm install npm -g
#Go
  - name: Add Go repository
    apt_repository:
      repo: ppa:gophers/go
      state: present
      update_cache: yes
  - name: Install Go
    apt:
      name: golang-go
      state: present
      update_cache: yes
  - name: Update Go environment
    lineinfile:
      path: ~/.bashrc
      line: export="$PATH:/usr/bin/go"

#Puppet
  - name: Download puppet
    get_url: 
      dest: /tmp/puppetlabs-release-trusty.deb
  - name: Install puppet
    apt: 
      deb: /tmp/puppetlabs-release-trusty.deb
      state: present
      update_cache: yes
# AWS CLI
  - name: create directory .aws
    file:
      path: /root/.aws
      state: directory
      mode: '0644'

# Install preconfigured Debian packages
  - name: install apt packages
    apt:
      name: "{{ item }}"
      state: present
      update_cache: yes
    # TODO: Update this with your file
    with_lines: cat ../config/apt.nodejs10-test-pnr-v3.mf 

Thanks 
Toan


 
Reply all
Reply to author
Forward
0 new messages