Skip to content
This repository has been archived by the owner on Feb 9, 2024. It is now read-only.

Latest commit

 

History

History
98 lines (70 loc) · 2.4 KB

image-info.md

File metadata and controls

98 lines (70 loc) · 2.4 KB

AVD Base Image Information

Docker image: avdteam/base

Description

Image information

Installed elements during build

Installed during container startup

  • CMD configured to support ENV configuration.

CMD script example:

#!/bin/bash

# Install specific requirement file
if [ ! -z "${AVD_REQUIREMENTS}" ]; then
  if [ -f ${AVD_REQUIREMENTS} ]; then
    echo "Install new requirements from ${AVD_REQUIREMENTS}"
    pip3 install --user -r ${AVD_REQUIREMENTS}
  else
    echo "Requirement file not found, skipping..."
  fi
fi

# Install specific ANSIBLE version
if [ ! -z "${AVD_ANSIBLE}" ]; then
    echo "Install ansible with version ${AVD_ANSIBLE}"
    pip3 install --user ansible==${AVD_ANSIBLE}
fi

exec /bin/zsh

Build local images

You can use this repository to build your own version to test lib upgrade or a new flavor. it creates an image based on:

  • DOCKER_NAME: Name of the container. Default is avdteam/base
  • FLAVOR: Python version to build image. it is also folder where Dockerfile is.
  • BRANCH: git branch from where you build your image. if name is master, then it is skipped
DOCKER_NAME:BRANCH-FLAVOR

Examples:

$ docker images avdteam/base
REPOSITORY          TAG                 IMAGE ID            CREATED             SIZE
avdteam/base        devel-3.8           3d4f4674300b        26 minutes ago      646MB
avdteam/base        3.6                 56e4a9d36bdf        40 minutes ago      675MB

Build process

$ make FLAVOR=3.8 build

Sending build context to Docker daemon  4.608kB
Step 1/21 : FROM python:3.7-slim as builder
 ---> 4cbd5021babc
Step 2/21 : ARG ANSIBLE=UNSET
 ---> Using cache
 ---> a41a97dc49b3
Step 3/21 : RUN apt-get update
 ---> Using cache
 ---> f052496c232e
  • Use native docker command:
$ docker build --rm --pull -t avdteam:base:3.6

In this command, replace 3.6 by flavor you want to build.

Create a new flavor

$ make new-flavor FLAVOR=3.9
cp -r _template 3.9
sed -i '' 's/FLAVOR/3.9/' 3.9/Dockerfile

Then build your image.