Skip to content

Commit 272aa45

Browse files
authored
feat: disable non sa logins during recovery (#16)
Sybase server port is opened while it is not completely setup (with multiple devices setup). Client using the image should not use SA account but instead use a non SA account so that the login will work when sybase becomes ready. - [x] set "enable logins during recovery" cf to 0 - [x] fix log by replacing "sybase started" to "docker-sybase started" - [x] add basic docker-compose example - [x] clean README
1 parent 2c0f8d1 commit 272aa45

File tree

5 files changed

+22
-3
lines changed

5 files changed

+22
-3
lines changed

Dockerfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ RUN . /opt/sap/SYBASE.sh \
2424
&& /opt/sap/ASE-16_0/bin/sqllocres -r /tmp/ASE/sqlloc1027.001-SYBASE.rs \
2525
&& rm -rf /tmp/ASE \
2626
&& sed -i -e 's/enable console logging = DEFAULT/enable console logging = 1/g' /opt/sap/ASE-16_0/SYBASE.cfg \
27+
&& sed -i -e 's/enable logins during recovery = DEFAULT/enable logins during recovery = 0/g' /opt/sap/ASE-16_0/SYBASE.cfg \
2728
&& sed -i -e 's/max memory = DEFAULT/max memory = 500000/g' /opt/sap/ASE-16_0/SYBASE.cfg \
2829
&& echo 'procedure cache size = 100000' >> /opt/sap/ASE-16_0/SYBASE.cfg \
2930
&& sed -i -e 's/localhost/0.0.0.0/g' /opt/sap/interfaces

README.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,8 @@ docker run --rm -it --name sybase -e SA_PASSWORD=Sybase1234 -e DATABASE=hello -p
1717
```
1818

1919
## Docker compose example
20-
see the [/docker-entrypoint-initdb.d/ folder example](https://github.com/cboudereau/docker-sybase/tree/main/.ci/init)
20+
- [Basic example](./examples/basic/compose.yml)
21+
- [Full example](./.ci/compose.yml)
2122
```yaml
2223
services:
2324
database:
@@ -28,6 +29,8 @@ services:
2829
- SA_PASSWORD=Sybase1234
2930
volumes:
3031
- ./init/:/docker-entrypoint-initdb.d/
32+
ports:
33+
- 5000:5000
3134
healthcheck:
3235
test: healthcheck
3336
interval: 5s

docker-entrypoint.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,13 +25,13 @@ run_init_files () {
2525
done
2626
}
2727

28-
echo "starting sybase..."
28+
echo "starting docker-sybase..."
2929
${SYBASE}/${SYBASE_ASE}/install/RUN_SYBASE &
3030

3131
while ! netstat -ltn | grep 5000; do
3232
sleep 0.1
3333
done
34-
echo "sybase started"
34+
echo "docker-sybase started"
3535

3636
if [[ ! -f "/.initialized" ]]; then
3737
DATABASE=${DATABASE-}

examples/basic/compose.yml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
services:
2+
database:
3+
image: superbeeeeeee/docker-sybase
4+
pull_policy: always
5+
environment:
6+
- DATABASE=hello
7+
- SA_PASSWORD=Sybase1234
8+
volumes:
9+
- ./init/:/docker-entrypoint-initdb.d/
10+
ports:
11+
- 5000:5000
12+
healthcheck:
13+
test: healthcheck
14+
interval: 5s

examples/basic/init/1_hello-world.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
echo "hello world"

0 commit comments

Comments
 (0)