country_code

Create the Dockerfile#

  1. Create the Dockerfile in your working directory

    touch Dockerfile
    nano Dockerfile
    
  2. Copy the following content into the Dockerfile

    FROM kit_app_template:latest
    
    USER root
    
    RUN apt-get update && \
       apt-get install -y curl && \
       mkdir -p /opt/vector && \
       curl -L
    https://packages.timber.io/vector/0.46.1/vector-0.46.1-x86_64-unknown-linux-gnu
    .tar.gz -o /tmp/vector.tar.gz && \
       tar -xzf /tmp/vector.tar.gz -C /opt/vector --strip-components=2 && \
       rm -rf /tmp/vector*
    
    RUN mkdir -p /logs
    
    # Ensure ubuntu home directory exists for NVCF compatibility (user already
    exists in base image)
    RUN mkdir -p /home/ubuntu && \
       chown -R ubuntu:ubuntu /home/ubuntu
    
    # Create Vector data directory and give ubuntu user access
    RUN mkdir -p /var/lib/vector && \
       chown -R ubuntu:ubuntu /var/lib/vector
    
    COPY entrypoint_vector_dev.sh /entrypoint_vector_dev.sh
    COPY vector.toml /opt/vector/static_config.toml
    RUN chmod +x /entrypoint.sh /entrypoint_vector_dev.sh
    
    # Switch back to ubuntu user for runtime
    USER ubuntu
    
    ENTRYPOINT ["/entrypoint_vector_dev.sh"]
    
  3. Build the Kit Vector Container image

    1. Before building the container, verify that you have all the necessary files in the current directory:

      ls -la
      

      You should see the following required files if you followed along with the documentation:

      ../_images/build_kit_vector_container_image.png
    2. Build your enhanced Kit container with Vector integration:

      docker build -t byoo_kit_vector:latest .
      

      If you followed along the steps, the required files for the Dockerfile should have been created.

    3. Verify the docker image:

      docker image ls
      

      This concludes the docker image creation process.

      Follow Deploying to Kit Apps to push your container to NGC.