Open lmorroni opened 3 years ago
Hi @lmorroni
Can you try installing it with Homebrew after uninstalling the gem?
https://brew.sh https://formulae.brew.sh/formula/dory#default
Thank you, sir. That worked!
Nice! You're welcome! :)
Sorry, spoke too soon. Looks like dory up
is looking for an AMD image but needs the ARM image.
╰─➤ dory up
WARNING: The requested image's platform (linux/amd64) does not match the detected host platform (linux/arm64/v8) and no specific platform was requested
Here's the docker ps -a output
38fdcc450d2b freedomben/dory-http-proxy:2.5.9.1 "/app/docker-entrypo…" 9 seconds ago Exited (2) 6 seconds ago dory_dinghy_http_proxy
I have a generic ~/.dory.yml file freshly generated. Larry
Ah, yeah, that's because the docker images aren't build for the ARM architecture. :( I will try to see if I can make builds for arm and test them on my Raspberry pi, @lmorroni.
I do not mind helping here. Can you point me towards the Dockerfile?
@lmorroni https://github.com/FreedomBen/dory-http-proxy https://docs.docker.com/engine/reference/commandline/buildx
You might actually be able to run the image with --platform linux/amd64
; not sure if it will be too slow.
I got this working but I had to rebuild the dinghy-http-proxy docker container first. I'm not sure how I can contribute this but I am providing my shell commands below. Hope this helps.
git clone https://github.com/codekitchen/dinghy-http-proxy.git
cd dinghy-http-proxy
docker build -t codekitchen/dinghy-http-proxy:2.5 -t codekitchen/dinghy-http-proxy:latest .
cd ..
git clone https://github.com/FreedomBen/dory-http-proxy.git
cd dory-http-proxy
docker build -t freedomben/dory-http-proxy:2.5.9.1 -t freedomben/dory-http-proxy:latest .
dory up
@lmorroni
I tried to build the docker images for ARM but I have only tested on x86_64. Can you test this?
dory down
~/.dory.yml
with the config below (with specified images build with support for ARM)dory up
---
dory:
# Be careful if you change the settings of some of
# these services. They may not talk to each other
# if you change IP Addresses.
# For example, resolv expects a nameserver listening at
# the specified address. dnsmasq normally does this,
# but if you disable dnsmasq, it
# will make your system look for a name server that
# doesn't exist.
dnsmasq:
enabled: true
domains: # array of domains that will be resolved to the specified address
- domain: docker # you can set '#' for a wilcard
address: 127.0.0.1 # return for queries against the domain
container_name: dory_dnsmasq
port: 53 # port to listen for dns requests on. must be 53 on linux. can be anything that's open on macos
# kill_others: kill processes bound to the port we need (see previous setting 'port')
# Possible values:
# ask (prompt about killing each time. User can accept/reject)
# yes|true (go aheand and kill without asking)
# no|false (don't kill, and don't even ask)
kill_others: ask
service_start_delay: 5 # seconds to wait after restarting systemd services
image: tripox/dory-dnsmasq:latest
nginx_proxy:
enabled: true
container_name: dory_dinghy_http_proxy
https_enabled: true
ssl_certs_dir: '' # leave as empty string to use default certs
port: 80 # port 80 is default for http
tls_port: 443 # port 443 is default for https
image: tripox/dory-http-proxy:latest
resolv:
enabled: true
nameserver: 127.0.0.1
port: 53 # port where the nameserver listens. On linux it must be 53
My test on this one failed. I'm glad you showed me the image config option though. I can use that with the images that I built and it works. Here is the docker output from the failed container dory_dinghy_http_proxy
WARNING: /etc/nginx/dhparam/dhparam.pem was not found. A pre-generated dhparam.pem will be used for now while a new one
is being generated in the background. Once the new dhparam.pem is in place, nginx will be reloaded.
Generating DH parameters, 2048 bit long safe prime, generator 2
runtime: failed to create new OS thread (have 2 already; errno=22)
fatal error: newosproc
runtime stack:
runtime.throw(0x884500, 0x9)
/usr/local/go1.6/src/runtime/panic.go:530 +0x90
runtime.newosproc(0xc820026000, 0xc820035fc0)
/usr/local/go1.6/src/runtime/os1_linux.go:149 +0x18c
runtime.newm(0x932358, 0x0)
/usr/local/go1.6/src/runtime/proc.go:1513 +0x135
runtime.main.func1()
/usr/local/go1.6/src/runtime/proc.go:125 +0x2c
runtime.systemstack(0xa8e800)
/usr/local/go1.6/src/runtime/asm_amd64.s:291 +0x79
runtime.mstart()
/usr/local/go1.6/src/runtime/proc.go:1048
goroutine 1 [running]:
runtime.systemstack_switch()
/usr/local/go1.6/src/runtime/asm_amd64.s:245 fp=0xc820020770 sp=0xc820020768
runtime.main()
/usr/local/go1.6/src/runtime/proc.go:126 +0x62 fp=0xc8200207c0 sp=0xc820020770
runtime.goexit()
/usr/local/go1.6/src/runtime/asm_amd64.s:1998 +0x1 fp=0xc8200207c8 sp=0xc8200207c0
That's certainly an interesting error and not one I had expected.
Need to get one of those Raspberry Pi running. 😄
Thank you for your time and input. I appreciate it.
Oh, dinghy-http-proxy uses Go to compile for x86. Now it makes sense.
Hey @FreedomBen Is there any active development on this issue? 😁
I've got Dory working on my M1 by switching the nginx_proxy
image
in config to taybenlor/dinghy-http-proxy:latest
(see: https://github.com/codekitchen/dinghy-http-proxy/pull/59). Internally it seems like Dory switches between dory-http-proxy
and dinghy-http-proxy
depending on whether you are configuring certs or not. So I think this image will only work if you have a ssl_certs_dir
configured.
Edit: I've just built taybenlor/dory-http-proxy:latest
based off my taybenlor/dinghy-http-proxy:latest
you could try using this if you are not configuring ssl_certs_dir
. I can't confirm if it works or not, sorry!
Hi @taybenlor
Thanks. I got the taybenlor/dory-http-proxy:latest
image to work! Also without specifying the ssl_certs_dir
. If anyone is interested, here is my ~/.dory.yml
---
dory:
# Be careful if you change the settings of some of
# these services. They may not talk to each other
# if you change IP Addresses.
# For example, resolv expects a nameserver listening at
# the specified address. dnsmasq normally does this,
# but if you disable dnsmasq, it
# will make your system look for a name server that
# doesn't exist.
dnsmasq:
enabled: true
domains: # array of domains that will be resolved to the specified address
- domain: docker # you can set '#' for a wilcard
address: 127.0.0.1 # return for queries against the domain
container_name: dory_dnsmasq
port: 53 # port to listen for dns requests on. must be 53 on linux. can be anything that's open on macos
# kill_others: kill processes bound to the port we need (see previous setting 'port')
# Possible values:
# ask (prompt about killing each time. User can accept/reject)
# yes|true (go aheand and kill without asking)
# no|false (don't kill, and don't even ask)
kill_others: ask
service_start_delay: 5 # seconds to wait after restarting systemd services
nginx_proxy:
enabled: true
container_name: dory_dinghy_http_proxy
https_enabled: true
ssl_certs_dir: '' # leave as empty string to use default certs
port: 80 # port 80 is default for http
tls_port: 443 # port 443 is default for https
image: taybenlor/dory-http-proxy:latest
resolv:
enabled: true
nameserver: 127.0.0.1
port: 53 # port where the nameserver listens. On linux it must be 53
The only thing different from this and the default config is the change in nginx_proxy
image as described above.
🎉
I can confirm this works on M1. I'll take a look at this. Thanks @mikkelblyme, @taybenlor and @taybenlor for your contributions.
It works for me on an M1 too! Thanks @mikkelblyme
I don't know if this is the right place, or should I create another issue, but for me when if I'm trying to access my site on https
the cert is invalid
Can someone point me in the right direction about how to create/make a cert that is accepted by the browser?
@kristof-kasa No problem, but you should thank https://github.com/taybenlor :slightly_smiling_face:
You should be able to use a project like https://github.com/FiloSottile/mkcert to create certificates.
@kristof-kasa No problem, but you should thank https://github.com/taybenlor 🙂
You should be able to use a project like https://github.com/FiloSottile/mkcert to create certificates.
@mikkelblyme Yes, thank you! With mkcert I managed to create everything correctly.
If anyone interested in the setup:
$ brew install mkcert
$ mkcert -install
$ mkdir certs
$ cd certs
$ mkcert custom-local-domain.com "*.custom-local-domain.com" localhost 127.0.0.1 ::1
$ cp custom-local-domain.com+4-key.pem default.key
$ cp custom-local-domain.com+4.pem default.crt
In .dory.yml
set your ssl_certs_dir
and custom domain
dnsmasq:
...
domains:
- domain: custom-local-domain.com
address: 127.0.0.1
...
nginx_proxy:
...
image: taybenlor/dory-http-proxy:latest
ssl_certs_dir: '/Users/<username>/code/local-dev-https-setup/certs'
...
Hello, Been using dory for a number of years on OSX. Just upgraded to the M1 chip and Big Sur. When I install dory using
gem install dory
and then I rundory
. I get the following error:Any ideas? Thank You, Larry