oci-arm-host-capacity
oci-arm-host-capacity copied to clipboard
Add env OCI_DISPLAY_NAME to set display name
Add env OCI_DISPLAY_NAME to set display name
I created a docker image with your code
https://hub.docker.com/r/hassegawa/machine
Hi, could you please share Dockerfile
?
As for the instance name, it’s better to implement through a setter instead of argument: by changing the arguments/their order we can ruin those who will watch YouTube or read Medium :) I’ll do this later, maybe, thank you
…or just simple getter which will fallback with a default value if env var is not set
…or just simple getter which will fallback with a default value if env var is not set
index.php
getenv('OCI_DISPLAY_NAME') ?: 'instance-' . date('Ymd-Hi'),
Hi, could you please share
Dockerfile
?
- https://github.com/hassegawa/oracle-tf
- change line 17:
- git clone https://github.com/hassegawa/oci-arm-host-capacity.git && \
- change line 17:
Dockerfile with build per layer for build performance
https://github.com/hassegawa/oracle-tf/tree/performance
github action
https://github.com/hassegawa/oci-arm-host-capacity/commit/4eb053a31291d6fea400ba267e883e984b14b85b
@hassegawa
Please check that your Docker container's run.sh
file permission is missing the execution bit.
I have confirmed this ↓
/bin/sh: 1: ./run.sh: Permission denied
I have tested latest
tag (maybe now equal hassegawa/machine:0.1.12
).
Thanks.
@hassegawa Please check that your Docker container's
run.sh
file permission is missing the execution bit. I have confirmed this ↓/bin/sh: 1: ./run.sh: Permission denied
I have tested
latest
tag (maybe now equalhassegawa/machine:0.1.12
).Thanks.
'latest' and 0.1.12 are same:
@hassegawa Please check that your Docker container's
run.sh
file permission is missing the execution bit. I have confirmed this ↓/bin/sh: 1: ./run.sh: Permission denied
I have tested
latest
tag (maybe now equalhassegawa/machine:0.1.12
).Thanks.
Can you try again? 0.1.13 or latest
@hassegawa I tested your docker image, it works nicely :). My command:
docker run --rm -d \
-v $(pwd)/.env:/app/oci-arm-host-capacity/.env \
-v $(pwd)/key.pem:/app/oci-arm-host-capacity/key.pem \
hassegawa/machine
I also use relative path ./key.pem
in my .env
file, it still works 😄
Maybe introduce RETRY_DELAY_TIME
env to adjust the sleep time?
By the way, I created a Dockerfile using alpine, the image size is very small ~190MB.
FROM composer:2
RUN apk add --no-cache jq~=1.6
WORKDIR /app/oci-arm-host-capacity
COPY ./oci-arm-host-capacity /app/oci-arm-host-capacity
RUN chmod +x run.sh \
&& cd /app/oci-arm-host-capacity && \
composer update && \
composer install
ENTRYPOINT [ "sh", "run.sh" ]
jq
is not working with it yet because php
will return some deprecated messages: Deprecated: Function openssl_free_key() is deprecated in /app/oci-arm-host-capacity/vendor/hitrov/oci-api-php-request-sign/src/Hitrov/OCI/Signer.php on line 115
However I think this approach produces a better image, easier to maintain.
By the way, I created a Dockerfile using alpine, the image size is very small ~190MB.
FROM composer:2 RUN apk add --no-cache jq~=1.6 WORKDIR /app/oci-arm-host-capacity COPY ./oci-arm-host-capacity /app/oci-arm-host-capacity RUN chmod +x run.sh \ && cd /app/oci-arm-host-capacity && \ composer update && \ composer install ENTRYPOINT [ "sh", "run.sh" ]
jq
is not working with it yet becausephp
will return some deprecated messages:Deprecated: Function openssl_free_key() is deprecated in /app/oci-arm-host-capacity/vendor/hitrov/oci-api-php-request-sign/src/Hitrov/OCI/Signer.php on line 115
However I think this approach produces a better image, easier to maintain.
we cam try remove this function:
@hassegawa I tested your docker image, it works nicely :). My command:
docker run --rm -d \ -v $(pwd)/.env:/app/oci-arm-host-capacity/.env \ -v $(pwd)/key.pem:/app/oci-arm-host-capacity/key.pem \ hassegawa/machine
I also use relative path
./key.pem
in my.env
file, it still works 😄Maybe introduce
RETRY_DELAY_TIME
env to adjust the sleep time?
To set RETRY_DELAY_TIME = 5 minutes, TAG >= v0.1.14
docker run --rm -d \
-e RETRY_DELAY_TIME=5 \
-v $(pwd)/.env:/app/oci-arm-host-capacity/.env \
-v $(pwd)/key.pem:/app/oci-arm-host-capacity/key.pem \
hassegawa/machine
- RETRY_DELAY_TIME default is 10 minutes