When using pythonRequirements>dockerizePip: true , within codebuild, must I use ecr? - python-3.x

custom:
pythonRequirements:
dockerizePip: true
in Python lambda using serverless with dockerizePip , I'm getting this message.
I know dockerizePip uses docker and it works fine in the local. But, when using it via pipeline, the container it uses to build doesn't seem to have 'docker' there.
Or, Maybe it's there but not running? I get this error message.
Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?
Should I use ECR when I use dockerizePip : true?
Is there a way to not use ECR?

You don't need to use ECR, but docker daemon has to be running on the machine. Docker container will be launched to actually build your dependencies with serverless-python-requirements plugin. You can also try specifying dockerizePip: non-linux, as it might not be needed to dockerize packaging when running on linux machine, but I would advise to test it first on non-prod environment.

Related

How to fail gitlab pipeline from docker container?

I run tests inside docker container on a shell runner (NodeJS/jest);
How can I fail gitlab pipeline if tests fail from inside the container?
I've tried process.exit(1) in case there are failing tests but it didn't help.
I considered running tests as part of Dockerfile RUN but I need the
environment variables to configure URLs to other containers.
Since all tests are http calls to other containers I also expect that after_script will work for tearing down the environment regardless of the outcome.
When using docker compose, you'll need to use the --exit-code-from to specify the service that should be used for the exit code of the docker-compose command.
See also: https://stackoverflow.com/a/43367250/5747944

Azure app service doesn't install docker properly

I am currently trying to start ElasticSearch on an Azure app service using Docker. I install docker through the ssh available in azure app services. Docker seem to install alright in the console, however when I run
docker pull docker.elastic.co/elasticsearch/elasticsearch:7.6.2
I get the following error in the ssh console:
Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?
I have installed and uninstall Docker several times, however I still get the same error
Azure App service does not allow you to run Elastic Search due to its limitations
You may use Elastic as a Service on Azure or install it in AKS or VM.
https://azuremarketplace.microsoft.com/en-us/marketplace/apps/elastic.ec-azure?tab=Overview
You are trying to install Docker inside the Docker container
App Service for Linux comes with a bunch of preconfigured containers such as Node, PHP, Java, Python, Ruby and .NET Core.
https://anthonychu.ca/post/jekyll-azure-app-service-linux/
The exact issue you mentioned means that Docker daemon is not started in your Linux environment
To start the Docker daemon use command:
systemctl start docker

How to run a docker container as a windows service

I have a windows service that I want to run in a docker container on Azure.
I would like to have the same setup when running the service locally, so I would like to run the same docker container locally as a windows service (I think?).
How would I do that? Or is there a better approach?
Thanks,
Michael
IMHO Michael asked how to start docker images without the need to have a user logged in. The docker restart flag actually only deals with starting images after docker is running. To get docker to run without logged in user (or after automatic windows updates) it seems to me you will also need to make a windows service that runs docker.
A good explanation for this part of the problem can be found here (no good solution has been found yet without paying for it - docker team ignored request to make this work without third party so far):
How to start Docker daemon (windows service) at startup without the need to log-in?
You can use the flag --restart=unless-stopped with the docker run command and the docker container will run automatically even if the server was shutdown.
Further read for the restart policy and flag here
but conditions apply - docker itself should always run on startup. which is default setting by itself.

Docker Cloud and JHipster console

Is it possible to set up JHipster console on Docker Cloud? My application is deployed on Heroku.
If is there no option, please advise where can I set up docker in cloud.
Regards!
Yes docker cloud is an option although I've never tried it. If you have simple needs and don't need container orchestration on multiple hosts I would recommend creating a simple VM with docker on your favorite cloud provider (using docker-machine for example) and then deploy the console there using docker-compose. It's really easy to do.
1) SSH on your server
2) Install docker and docker-compose
3) Get the docker-compose file from https://github.com/jhipster/jhipster-console/blob/master/bootstrap/docker-compose.yml
4) Run docker-compose up -d
The console will be available on port 5601.
Refer to the docs at : https://jhipster.github.io/monitoring/
More advanced setup are possible but this is the easiest way to go. Also note that it is perfectly possible to run the JHipster-Console without Docker but it requires some work. To do this, setup an ELK stack yourself usinh on simple logstash configuration and scripts to preload the dashboards.
Ok, locally everything is fine. So how (step by step) push JHipster Console to docker-cloud and connect it with my application on heroku?

Azure Docker Container - how to pass startup commands to a docker run?

Faced with this screen, I have managed to easily deploy a rails app to azure, on docker container app service, but logging it is a pain since the only way they have access to logs is through FTP.
Has anyone figured out a good way to running the docker run command inside azure so it essentially accepts any params.
in this case it's trying to simply log to a remote service, if anyone also has other suggestions of retrieving logs except FTP, would massively appreciate.
No, at the time of writing this is not possible, you can only pass in anything that you would normally pass to docker run container:tag %YOUR_STARTUP_COMMAND_WILL_GO_HERE_AS_IS%, so after your container name.
TLDR you cannot pass any startup parameters to Linux WebApp except for the command that needs to be run in the container. Lets say you want to run your container called MYPYTHON using the PROD tag and run some python code, you would do something like this
Startup Command = /usr/bin/python3 /home/code/my_python_entry_point.py
and that would get appended (AT THE VERY END ONLY) to the actual docker command:
docker run -t username/MYPYTHON:PROD /usr/bin/python3 /home/code/my_python_entry_point.py

Resources