a

    Alex Welch

    2 years ago
    when using the docker container, is there a way to not jump into python when it is launched?
    Chris White

    Chris White

    2 years ago
    Hi Alex, not sure of the context you’re working with, but you can interact with docker containers in many ways. I generally prefer using
    run -it
    / exec -it:
    docker run -it prefecthq/prefect echo 'hi'
    docker exec -it prefecthq/prefect bash
    a

    Alex Welch

    2 years ago
    when i run it via
    docker run -it prefecthq/prefect:latest
    it loads to a python prompt
    Chris White

    Chris White

    2 years ago
    correct because you didn’t specify a command, therefore it will use the default command for that image which is
    python
    a

    Alex Welch

    2 years ago
    for context, I wanted to run prefect within a docker container so that my team was always working with the most up-to-date version. The idea would be to mount anything needed and then when developing jump in the container so that the workflow is OS agnostic
    also.. duh, i should have realized that
    dbt_image:
          image: <internal dbt-image>image:latest
          environment:
            DBT_PROFILES_DIR: /usr/local/dbt_profiles/
            SNOWFLAKE_SNAPSHOT_DATABASE: "SNOWFLAKE"
            SNOWFLAKE_LOAD_DATABASE: "RAW"
            SNOWFLAKE_TRANSFORM_WAREHOUSE: "ANALYST_XS"
          restart: always
          command: bash -c "/bin/bash"
          working_dir: /usr/local/analytics/transform/snowflake-dbt/
          volumes:
            - type: bind
              source: .
              target: /usr/local/analytics
            - type: bind
              source: ${DBT_PROFILE_PATH}
              target: /usr/local/dbt_profiles/
              read_only: True
    sorry, hit enter too early
    but this is from our docker-compose file for dbt, which we spin up and then work out of, and wanted to do something similar
    Chris White

    Chris White

    2 years ago
    ah ok awesome, yea that should be doable for prefect for sure
    a

    Alex Welch

    2 years ago
    however, when i try to run
    prefect server start
    inside the container i get errors such as ‘No such file or directory: ip’
    docker run -it -p 8080:8080 prefecthq/prefect:latest bash
    Chris White

    Chris White

    2 years ago
    a

    Alex Welch

    2 years ago
    thank you, ill take a look
    i see that a flag was added but i dont see any documentation about how to enable it
    Chris White

    Chris White

    2 years ago
    which flag?
    a

    Alex Welch

    2 years ago
    the error i was getting seems to be that the contained docker instance cant find the right network, and there was a flag established to toggle that check