https://prefect.io logo
Title
a

Alex Welch

05/27/2020, 5:08 PM
when using the docker container, is there a way to not jump into python when it is launched?
c

Chris White

05/27/2020, 5:10 PM
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
:upvote: 1
a

Alex Welch

05/27/2020, 5:11 PM
when i run it via
docker run -it prefecthq/prefect:latest
it loads to a python prompt
c

Chris White

05/27/2020, 5:11 PM
correct because you didn’t specify a command, therefore it will use the default command for that image which is
python
a

Alex Welch

05/27/2020, 5:12 PM
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
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

Chris White

05/27/2020, 5:15 PM
ah ok awesome, yea that should be doable for prefect for sure
a

Alex Welch

05/27/2020, 5:17 PM
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

Alex Welch

05/27/2020, 5:31 PM
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

Chris White

05/27/2020, 5:46 PM
which flag?
a

Alex Welch

05/27/2020, 5:48 PM
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