Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WakaTime not working inside alpine docker container without glibc. #180

Closed
9brada6 opened this issue Feb 3, 2021 · 5 comments
Closed

WakaTime not working inside alpine docker container without glibc. #180

9brada6 opened this issue Feb 3, 2021 · 5 comments

Comments

@9brada6
Copy link

9brada6 commented Feb 3, 2021

Hi, I want to use WakaTime inside a docker container, with alpine Linux. All my other extension work good, but WakaTime is not working.
It says that creates a log file inside the root directory, but I don't see being created.

This is what it says in developer workbrench, with debug enabled:

image

@9brada6 9brada6 changed the title WakaTime now working inside docker container? WakaTime not working inside docker container? Feb 3, 2021
@9brada6
Copy link
Author

9brada6 commented Feb 3, 2021

It seems that in another ubuntu container it works properly...

@9brada6
Copy link
Author

9brada6 commented Feb 3, 2021

Steps to reproduce:

  1. copy the text below and place it in a file named dockerfile.
  2. cd into directory
  3. build the image: "docker build -t waka_test ."
  4. run the image: "docker run --rm --name wakatest waka_test" (nothing is displayed, image keep running)
  5. Open vscode, install docker remote extension, connect to container, install wakatime extension, insert api-key, watch not working.

I think a package is missing, but I can't figure out what...

FROM alpine:edge as dev

# Add apk repository
RUN apk --no-cache add --repository http://dl-cdn.alpinelinux.org/alpine/edge/community/ tini && \
# Install PHP8 dependencies and build dependencies
apk --no-cache \
add \
bash \
ca-certificates \
curl \
git \
nodejs \
npm \
php8 \
php8-sqlite3 \
php8-mbstring \
php8-curl \
php8-openssl \
php8-xmlreader \
php8-phar \
php8-dom \
php8-pcntl \
php8-tokenizer \
php8-xml \
php8-simplexml \
php8-iconv \
php8-pecl-ast \
php8-xmlwriter && \
apk update && \
# Todo: find a way to install "php8" as "php" command.
mv /usr/bin/php8 /usr/bin/php && \
echo "post_max_size=1020M" >> /etc/php8/php.ini && \
echo "memory_limit = 2048M" >> /etc/php8/php.ini && \
# Install Composer.
cd /tmp && \
php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');" && \
php -r "if (hash_file('sha384', 'composer-setup.php') === '756890a4488ce9024fc62c56153228907f1545c228516cbf63f885e036d37e9a59d27d63f46af1d4d07ee0f76181c7d3') { echo 'Installer verified'; } else { echo 'Installer corrupt'; unlink('composer-setup.php'); } echo PHP_EOL;" && \
php composer-setup.php --install-dir=/usr/bin --filename=composer && \
php -r "unlink('composer-setup.php');"

# Keep Container open.
ENTRYPOINT [ "/bin/bash", "-l", "-c" ]
CMD [ "while true; do sleep 1000; done" ]

@9brada6
Copy link
Author

9brada6 commented Feb 3, 2021

I fixed this by changed FROM to use an alpine image with glibc: https://hub.docker.com/r/frolvlad/alpine-glibc/

@9brada6 9brada6 changed the title WakaTime not working inside docker container? WakaTime not working inside alpine docker container without glibc. Feb 3, 2021
@gandarez
Copy link
Member

gandarez commented May 4, 2021

Try adding these lines to your ~/.wakatime.cfg file:

standalone = false
alpha = true

Then restart VS Code. Does that fix it?

@alanhamlett
Copy link
Member

Closing since no activity lately. Might be duplicate of #130, #169, #244.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants