I need help. Why error docker-compuse, wireguard? - docker

Error: You might be seeing this error because you're using the wrong Compose file version. Either specify a supported version (e.g
"2.2" or "3.3") and place your service definitions under the
services key, or omit the version key and place your service
definitions at the root of the file to use version 1. For more on the
Compose file format versions, see
https://docs.docker.com/compose/compose-file/
Yaml:

You have a typo in the first line. Probably it should start with version: 3.3 link.

Related

Serverless Version Upgrade Name resolution errors

I was trying to update the serverless version for my project from 2.72 to 3.x. Hence I started working on the resolution of the deprecations warnings. All are gone except of the following.
Cannot resolve variable at "resources.Resources.ApiGatewayAcessLogsSubscriptionFilter.Properties.DestinationArn": String value consist of variable which resolve with non-string value
The variable inside the serverless.yml is referenced as follow
{self:custom.localEnvironment.logs-destination.${self:provider.region}}
The custom section of the serverless.yml is defined as follow:
custom:
localEnvironment:
logs-destination:
region-x: "**** destination log group"
Environment Information
Your Environment Information ---------------------------
Operating System: darwin
Node Version: 14.20.0
Framework Version: 2.72.3 (local)
Plugin Version: 5.5.4
SDK Version: 4.3.2
Components Version: 3.18.2
Note env says version is 2.72.3 but to enforce the new name resolver I am using the following in the file
variablesResolutionMode: 20210326
I looked for various resources on the serverless forums, didn't find something which match exactly with my situation. Though I have found the following un-answered question
https://forum.serverless.com/t/variables-resolution-errored/16999
P.S. New to the community please feel free to edit the question.

Docker compose invalid top-level property "name"

I'm trying to set up my docker project name, and according to documentation there should be the docker compose file top-level property 'name' to do so, but I can't figure out how to use it.
I found references at the end of The Compose application model section and in the specific Name top-level element section, but none of the two have an example and I still get an error when trying to run docker-compose up -d
docker-compose.yml file
version: "3.3"
name: "project-name"
services:
# ...
The error
ERROR: The Compose file './docker-compose.yml' is invalid because:
Invalid top-level property "name". Valid top-level sections for this Compose file are: version, services, networks, volumes, secrets, configs, and extensions starting with "x-".
You might be seeing this error because you're using the wrong Compose file version. Either specify a supported version (e.g "2.2" or "3.3") and place your service definitions under the `services` key, or omit the `version` key and place your service definitions at the root of the file to use version 1.
For more on the Compose file format versions, see https://docs.docker.com/compose/compose-file/
To use the compose-spec, you need a tool that parses that spec (like docker compose with a space) and you shouldn't be specifying a version. If you are parsing the file with an older version of docker-compose or a tool that doesn't use the spec, these newer fields won't work and you'll likely see it fall back to version 1 without a version field.
With version: "3.3", that expects the format defined in the version 3 documentation.

Deploying Cloud Run via YAML gives Revision named 'yourservicename-00001-soj' with different configuration already exists

When using the following command to deploy a new Cloud Run revision,
gcloud run services replace service.yaml
The deployment fails with this error
ERROR: (gcloud.run.services.replace) ALREADY_EXISTS: Revision named 'yourservicename-00001-soj' with different configuration already exists.
This occurs when you have followed Google's documentation which instructs you to pull down the current service YAML description into a file, make edits and then redeploy it.
This is because the documentation is wrong, or Google's service has regressed since it was authored.
Edit the YAML and remove spec.template.metadata.name and try again.

Docker compose yml alternatives

Yml depends on formatting for nested structures, and for inaccurate filled files it is very hard to find out all format errors that violate original meaning. Is there any alternative to yml format for docker-compose configuration file?
TLDR; No.
From Documentation
The Compose file is a YAML file defining services, networks and volumes. The default path for a Compose file is ./docker-compose.yml
Now to answer on your arguments regarding the format and the difficulty to find errors violating original meaning:
yamllint is a first tool that can help your validate your overall yaml syntax (whatever the target expected format).
docker-compose config will read your docker-compose.yml file in and report errors if it does not comply with the expected compose file format.

Installing Hyperledger fabric dependent binaries using Docker for Mac

I downloaded Docker for Mac since it was a prerequisite for Hyperledger Fabric (also listed here).
Now, I downloaded platform specific binaries listed here.
The instructions said:
If you are using Docker for Mac, you will need
to use a location under /Users, /Volumes, /private, or /tmp. To use a
different location, please consult the Docker documentation for file
sharing.
So,I used the following directory: /Users/user_name/Documents/Hyperledger\ Fabric/
I followed the same commands as listed on the site.
However, I was not able to add the line below to the ~/.bash_profile.
export PATH=/Users/user_name/Documents/Hyperledger\ Fabric/bin:$PATH
If I added the above line and ran the bash_profile, it gave an error and after that commands like ls, open were giving error not found.
It seems that there is a problem with the file location since I
installed Docker for Mac instead of Docker toolbox.
The problem is that your directory name contains a space. One way to avoid this problem is to specify a directory name that has no spaces. This would be the ideal approach since once you introduce a space in the PATH variable it would need to be quoted where used subsequently.
Alternately, you could set the path as:
export PATH="/Users/user_name/Documents/Hyperledger Fabric/bin":$PATH
However, as noted this has drawbacks.

Resources