when using the docker container, is there a way to...
# prefect-community
a
when using the docker container, is there a way to not jump into python when it is launched?
c
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`:
Copy code
docker run -it prefecthq/prefect echo 'hi'
docker exec -it prefecthq/prefect bash
upvote 1
a
when i run it via
docker run -it prefecthq/prefect:latest
it loads to a python prompt
c
correct because you didn’t specify a command, therefore it will use the default command for that image which is
python
a
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
💯 1
also.. duh, i should have realized that
😄 1
Copy code
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
c
ah ok awesome, yea that should be doable for prefect for sure
a
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
a
thank you, ill take a look
i see that a flag was added but i dont see any documentation about how to enable it
c
which flag?
a
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