How to view docker logs from vscode remote container?

I’m not using remote containers, just local once, so not sure if this applies but for locally running containers, you can go to the “Docker” tab (you need to install the official Microsoft Docker VS Code Plugin) where you can see your running containers. Just right-click on the container you want to see the logs … Read more

Docker compose port forwarding not working properly

In my case, I was using docker-compose run without the –service-ports argument, so port mappings were ignored. Example: docker-compose.yml version: “3” services: app-host: image: nginx:1.19.0-alpine working_dir: /app volumes: – ./:/app/ ports: – “80:3000” command docker-compose run –service-ports app-host References: discussion forum docker-compose documentation

Dockerfile: how to set env variable from file contents

Environment Variables If you want to set a number of environment variables into your docker image (to be used within the containers) you can simply use env_file configuration option in your docker-compose.yml file. With that option, all the entries in the .env file will be set as the environment variables in image and hence into … Read more

How to fix VersionConflict locking failure in pipenv?

Here are my debugging notes. Still not sure which package is causing the problem, but this does seem to fix it. The error you get when you first run pipenv install with pipenv version 2020.8.13. Traceback (most recent call last): File “/usr/local/bin/pipenv”, line 8, in <module> sys.exit(cli()) File “/usr/local/lib/python3.6/site-packages/pipenv/vendor/click/”, line 829, in __call__ return self.main(*args, … Read more

docker-entrypoint-initdb.d bad interpreter: Permission denied

I ended up running into this same issue. For anyone who faces this, you need to give execution permission to your script file, since Docker copies over permissions: chmod +x your/ In my case the issue msg was: /opt/bitnami/scripts/ /docker-entrypoint-initdb.d/ /bin/bash: bad interpreter: Permission denied Then I gave execution permission to and it worked … Read more

How to start service only when other service had completed?

This is a supplement to @zooblin ‘s answer Since docker-compose version 1.29, we can do it by condition: service_completed_successfully In your scene, database service start will cost some time, so the migration scripts should be executed after database fully started. And the application service should start after migration scripts executed successfully. the docker-compose.yaml may be … Read more

Volume mount when setting up WordPress with docker

Maybe I’ve found something… volumes: – wp-content:/var/www/html/wp-content According to this article: …wp-content contains all user-supplied content. Basically anything you can upload to your site ends up here. That doesn’t include anything you write, mind you. Those things are stored in the WordPress database. However, as long as you have both the database and your wp-content … Read more