Skip to content

Airgap example #25

@jaudiger

Description

@jaudiger

I was looking for an example about how to use Porter images (https://porter.sh/author-bundles/#images) with the mixin docker-compose.

Once published (https://porter.sh/distribute-bundles/#image-references-after-publishing), the images referenced are built into the archive, but if I try to use this archive on a machine without internet access, docker is trying to pull the images.

This is what I did so far:

porter.yaml:

name: redis-application
version: 0.1.0
description: Redis as a CNAB application
registry: MY_ACCOUNT_ID.dkr.ecr.eu-west-3.amazonaws.com

required:
  - docker:
      privileged: false

mixins:
  - docker-compose

images:
  redis:
    imageType: docker
    repository: docker.io/redis
    tag: 6.2.4

install:
  - docker-compose:
      description: Start redis
      suppress-output: true
      arguments:
      - up
      - -d

upgrade:
  - docker-compose:
      description: Run redis
      suppress-output: true
      arguments:
      - up
      - -d

uninstall:
  - docker-compose:
      description: Stop redis
      suppress-output: true
      arguments:
      - down

docker-compose.yml

version: "3.7"

services:
  redis-master:
    container_name: redis-master
    image: redis:6.2.4
    ports:
      - 6379:6379

  redis-slave:
    container_name: redis-slave
    image: redis:6.2.4
    ports:
      - 6380:6380
    command: redis-server --slaveof localhost 6379 --port 6380
    depends_on:
      - redis-master

My commands used:

porter build
porter publish

porter archive --reference MY_ACCOUNT_ID.dkr.ecr.eu-west-3.amazonaws.com/redis-application:v0.1.0 redis-application-installer.tgz

tar -zxvf redis-application-installer.tgz
porter install --allow-docker-host-access --cnab-file redis-application-installer/bundle.json redis-application

I think I missed something but I don't know what... I also tried to look at helm airgap example: https://github.com/getporter/porter/tree/main/examples/airgap

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions