Compare commits
19 Commits
Author | SHA1 | Date | |
---|---|---|---|
f00c0dd88d | |||
62d1938c89 | |||
7021f177f6 | |||
944190eedc | |||
ad3e4ad739 | |||
711e71709a | |||
cebd14e338 | |||
8968bb5450 | |||
726c32f5ea | |||
ab23734e25 | |||
9137d51267 | |||
a6bc8055f1 | |||
4ff525cf64 | |||
272a82e06a | |||
8a70aa4c49 | |||
e95c68243f | |||
102747d49d | |||
909fb5bc1f | |||
a771587de6 |
@ -8,7 +8,14 @@ before_script:
|
||||
- apk add --no-cache git openssl ca-certificates bash curl
|
||||
- apk add --no-cache make gcc g++ python linux-headers paxctl
|
||||
- apk add --no-cache libgcc libstdc++ gnupg nodejs nodejs-npm
|
||||
- apk add --no-cache krb5-libs
|
||||
- update-ca-certificates
|
||||
- cp ./stack-fix.c /lib/
|
||||
- set -ex
|
||||
- apk add --no-cache --virtual .build-deps build-base
|
||||
- gcc -shared -fPIC /lib/stack-fix.c -o /lib/stack-fix.so
|
||||
- apk del .build-deps
|
||||
- export LD_PRELOAD="/lib/stack-fix.so"
|
||||
- npm config set unsafe-perm true
|
||||
- npm install -g @shipzone/npmci
|
||||
- npmci npm prepare
|
||||
|
12
Dockerfile
12
Dockerfile
@ -19,4 +19,16 @@ RUN apk update && apk add --no-cache \
|
||||
nodejs-npm \
|
||||
&& update-ca-certificates
|
||||
|
||||
# Add the patch fix
|
||||
COPY ./stack-fix.c /lib/
|
||||
|
||||
# Prepare the libraries packages
|
||||
RUN set -ex \
|
||||
&& apk add --no-cache --virtual .build-deps build-base \
|
||||
&& gcc -shared -fPIC /lib/stack-fix.c -o /lib/stack-fix.so \
|
||||
&& apk del .build-deps
|
||||
|
||||
# export the environment variable of LD_PRELOAD
|
||||
ENV LD_PRELOAD /lib/stack-fix.so
|
||||
|
||||
RUN npm config set unsafe-perm true
|
||||
|
2
package-lock.json
generated
2
package-lock.json
generated
@ -1,5 +1,5 @@
|
||||
{
|
||||
"name": "ht-docker-dbase",
|
||||
"version": "1.0.26",
|
||||
"version": "1.0.37",
|
||||
"lockfileVersion": 1
|
||||
}
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "ht-docker-dbase",
|
||||
"version": "1.0.26",
|
||||
"version": "1.0.37",
|
||||
"description": "easy CI for docker images",
|
||||
"main": "index.js",
|
||||
"directories": {
|
||||
|
32
stack-fix.c
Normal file
32
stack-fix.c
Normal file
@ -0,0 +1,32 @@
|
||||
#include <dlfcn.h>
|
||||
#include <pthread.h>
|
||||
#include <stdio.h>
|
||||
|
||||
// THIS IS TO AVOID A SIGFAULT WHEN RUNNING python3.6 manage.py runserver
|
||||
// This should be fixed at some point by Alpine and/or Python
|
||||
// Check this issue for more info
|
||||
// https://github.com/docker-library/python/issues/211
|
||||
typedef int (*func_t)(pthread_t *thread, const pthread_attr_t *attr, void *(*start_routine)(void*), void *arg);
|
||||
|
||||
int pthread_create(pthread_t *thread, const pthread_attr_t *attr, void *(*start_routine)(void*), void *arg) {
|
||||
|
||||
pthread_attr_t local;
|
||||
int used = 0, ret;
|
||||
|
||||
if (!attr) {
|
||||
used = 1;
|
||||
pthread_attr_init(&local);
|
||||
attr = &local;
|
||||
}
|
||||
pthread_attr_setstacksize((void*)attr, 10 * 1024 * 1024); // 2 MB
|
||||
|
||||
func_t orig = (func_t)dlsym(RTLD_NEXT, "pthread_create");
|
||||
|
||||
ret = orig(thread, attr, start_routine, arg);
|
||||
|
||||
if (used) {
|
||||
pthread_attr_destroy(&local);
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
Reference in New Issue
Block a user