Giter Site home page Giter Site logo

Comments (16)

LucDrenth avatar LucDrenth commented on July 30, 2024 1

dev proxy is running, as in I can cntrl+c my way out of it. But it does not give any output so it seems like its stuck at startup. If I run the example curl command to call the proxy from inside the container I get a ‘connection refused’ error.

Eventually I’ll want to call the app from outside of the container, in which case I’ll need to expose the port or setup a network. But for now I’d like to just get a basic working version inside a docker container.

Thanks for the quick responses btw!

from dev-proxy.

waldekmastykarz avatar waldekmastykarz commented on July 30, 2024 1

I can repro your issue on my M2: basically Dev Proxy is stuck starting when ran in Docker on an M2. Let's take it up as a separate issue that we'll investigate. Thanks for bringing it up

from dev-proxy.

waldekmastykarz avatar waldekmastykarz commented on July 30, 2024 1

Hey @LucDrenth, I found a solution. Check out #639 for more info.

Also, I updated the base image to arm64v8/ubuntu:focal to avoid the warning about incompatible architecture.

from dev-proxy.

LucDrenth avatar LucDrenth commented on July 30, 2024

Any updates on this?

from dev-proxy.

waldekmastykarz avatar waldekmastykarz commented on July 30, 2024

Not at the moment. Would you prefer to use Dev Proxy inside a Docker container rather than having it on the host?

from dev-proxy.

LucDrenth avatar LucDrenth commented on July 30, 2024

Yes that would be ideal for our setup. I tried running it from a docker container myself but I can't get it to work yet. When running devproxy it starts a process but I'm not getting any output and the proxy is not working.

from dev-proxy.

waldekmastykarz avatar waldekmastykarz commented on July 30, 2024

Got it. Could you please share with us your Dockerfile and some more information about how you've been trying to use Dev Proxy (OS setup, type of app, etc.)?

from dev-proxy.

LucDrenth avatar LucDrenth commented on July 30, 2024

I'm trying to mock responses from the Microsoft Graph API.

Dockerfile

FROM amd64/ubuntu:focal

WORKDIR /src

RUN apt -y update 
RUN apt -y upgrade 
RUN apt install -y \
    curl \
    unzip

COPY install.sh ./
RUN chmod +x ./install.sh

ENTRYPOINT [ "./install.sh" ]

install.sh

#!/bin/bash

/bin/bash -c "$(curl -sL https://aka.ms/devproxy/setup.sh)"
source ~/.bashrc

# Prevents error "Couldn't find a valid ICU package" when running devproxy
export DOTNET_SYSTEM_GLOBALIZATION_INVARIANT=1

# TODO: Binary is not available in path for some reason so we need to specify use the binary location
./devproxy/devproxy

from dev-proxy.

waldekmastykarz avatar waldekmastykarz commented on July 30, 2024

Thanks! Is Dev Proxy running (I can see you're launching it at the end but want to double check it's working)? Is the app calling Microsoft Graph in the same Docker container as Dev Proxy or another (or on your host)?

from dev-proxy.

waldekmastykarz avatar waldekmastykarz commented on July 30, 2024

Cool, thanks for all the information. Let me see if I can replicate this and I'll get back to you

from dev-proxy.

waldekmastykarz avatar waldekmastykarz commented on July 30, 2024

It's working for me just fine. Here's what I've done:

  • built a new image using the files you shared
  • started a container: docker run --rm -it devproxy (the process ends with Dev Proxy running)
  • connected another terminal session to the running container: docker exec -it e65 bash (e65 is my conainer's name)
  • ran: curl -ikx http://127.0.0.1:8000 https://jsonplaceholder.typicode.com/posts which is intercepted by Dev Proxy

The default Dev Proxy config file is setup to intercept requests to https://jsonplaceholder.typicode.com/*. If you want to intercept calls to Microsoft Graph, you can use the Microsoft 365 specific preset, like devproxy --config-file ~appFolder/presets/m365.json

Hope this helps!

from dev-proxy.

LucDrenth avatar LucDrenth commented on July 30, 2024

This is not working on my machine (macbook M2). I'm trying exactly what you've done, with the only difference being that I add --platform linux/amd64 at the end of the docker run command. I'm guessing its an issue with me being on a macbook.

I'm curious what the last output of your container is. Mine looks like

Dev Proxy v0.16.1 installed!

To get started, run:
    source ~/.bashrc
    devproxy -h

from dev-proxy.

waldekmastykarz avatar waldekmastykarz commented on July 30, 2024

Is your install.sh file ending with ./devproxy/devproxy as you shared above?

For me, the output ends with Dev Proxy running (information about the IP address and the port it's using).

from dev-proxy.

waldekmastykarz avatar waldekmastykarz commented on July 30, 2024

I've got an M2 MBAir so can try it there too

from dev-proxy.

LucDrenth avatar LucDrenth commented on July 30, 2024

Yes my install script ends with running devproxy. I’m also not getting any output when running devproxy after manually logging in to the container. The curl to the proxy is not working.

from dev-proxy.

waldekmastykarz avatar waldekmastykarz commented on July 30, 2024

Let me see if I can repro that on my M2

from dev-proxy.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.